Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@mkuoppal
Copy link
Contributor

@mkuoppal mkuoppal commented Nov 8, 2024

  • Remove MONITOR_HEAP as there is adequate external tooling to cover similar functionality.
  • Avoid aligning mallocs to give full control to memory access debug tooling

@mkuoppal mkuoppal changed the title Alloc Alloc: Remove in tree heaplogging and avoid adding align to mallocs Nov 10, 2024
MONITOR_HEAP is a define which is used to track
memory allocations by file and line number. Altho this
has been useful to memory allocation problems, the
modern development environment have plethora of tools
just for this purpose: valgrind, mtrace,
electric fence, asan, msan etc.

Thus there should be no need to carry in tree malloc
debugging. Remove MONITOR_HEAP functionality.
Do not kneel in front of bad static analyzers
and try to align your allocs. This method of
extending/aligning over the native malloc uapi
will render some of the memory/malloc analyzer
detection useless, like not seeing out of bounds
accesses on non aligned ones.

Instead of catering to some bad analyzer, use native
malloc and thus give full visibility to proper ones.
If some architecture still needs aligment to long,
it should be special cased and not taint the sane ones.

Remove aligment padding from alloc(), return
void ptrs like in native malloc and deny zero sized
allocs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.