Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an alloc_array function #458

Merged
merged 5 commits into from
Oct 6, 2024
Merged

Conversation

aadit-n3rdy
Copy link
Contributor

This PR solves #440 and adds an alloc_array function. All uses of alloc_mem which can be replaced with alloc_array have been replaced with alloc_array. A test for stumpless_copy_entry has been added as well.

Copy link

codecov bot commented Oct 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.54%. Comparing base (1bd3333) to head (d8c8e05).
Report is 1 commits behind head on latest.

Additional details and impacted files
@@            Coverage Diff             @@
##           latest     #458      +/-   ##
==========================================
+ Coverage   90.35%   90.54%   +0.19%     
==========================================
  Files          47       47              
  Lines        4374     4379       +5     
  Branches      586      587       +1     
==========================================
+ Hits         3952     3965      +13     
+ Misses        287      280       -7     
+ Partials      135      134       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aadit-n3rdy
Copy link
Contributor Author

aadit-n3rdy commented Oct 5, 2024

Both the failed tests were in calls to alloc_mem, is this a problem with alloc_array? I'll look into this as well.

EDIT: Scratch that, forgot to free the entry I created in the test. My bad.

Copy link
Owner

@goatshriek goatshriek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work! Just a few cleanup items: make sure that you aren't using tabs anywhere, and move the large struct into the new test instead of making it a fixture structure.

src/memory.c Outdated Show resolved Hide resolved
test/function/entry.cpp Outdated Show resolved Hide resolved
test/function/entry.cpp Show resolved Hide resolved
@goatshriek goatshriek self-assigned this Oct 6, 2024
@goatshriek goatshriek merged commit 869bb49 into goatshriek:latest Oct 6, 2024
56 checks passed
@goatshriek goatshriek added the hacktoberfest-accepted accepted work that is valid for hacktoberfest label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted accepted work that is valid for hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants