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

Improve malloc debug #61

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Improve malloc debug #61

merged 3 commits into from
Nov 8, 2024

Conversation

HuseyinSimsek7904
Copy link
Member

Renamed the old file malloc.corth to _malloc.corth and renamed all the malloc functions with lower level procedure names. The new malloc.corth file now contains aliases to the lower level procedures. The debug_malloc.corth library now adds a tag to all the "malloced" objects which can be accessed to debug the memory leaks.

_malloc.corth contains the base procedures and the macros in
malloc.corth expands to those procedures so no run-time performance is
lost while using the regular dynamic memory management procedures.

This change is made to allow adding debugging tools to these procedures.
debug_malloc now defines its own version of malloc, mfree, mfree-deep
and mlength. These new macro can be used to add tags to dynamicly-placed
objects to test for memory leaks.

debug_malloc.corth and malloc.corth can no longer be included together.
@HuseyinSimsek7904 HuseyinSimsek7904 added the enhancement New feature or request label Nov 7, 2024
@HuseyinSimsek7904 HuseyinSimsek7904 self-assigned this Nov 7, 2024
@HuseyinSimsek7904 HuseyinSimsek7904 merged commit e85f010 into main Nov 8, 2024
1 check passed
@HuseyinSimsek7904 HuseyinSimsek7904 deleted the improve-malloc-debug branch November 8, 2024 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant