-
Notifications
You must be signed in to change notification settings - Fork 3k
Signature to track memory allocations by wrapper functions #8062
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
Conversation
cf22ce9
to
f949892
Compare
@ccli8 @cyliangtw - Please review |
/morph build |
Build : SUCCESSBuild number : 3226 Triggering tests/morph test |
Test : SUCCESSBuild number : 3029 |
/morph export-build |
Exporter Build : ABORTEDBuild number : 2814 |
/morph export-build |
Exporter Build : FAILUREBuild number : 2821 |
Please rebase, will restart testing |
malloc guarantees aligned memory. If we add an alignment here, we are adding additonal unused 4 bytes. Each allocator has its own 4/8 byte header (GGC / ARM have 4 bytes). So if user request for 8 bytes of memory stats will add 8 + allocator 8. However if we remove the alignment in stats header, allocator will consider add 4 bytes to 12 byte request and zero padding. It will be beneficial to leave the padding to allocator.
Compilers allocate some section of memory without using wrapper function, which is later freed when wrappers were initialized. Since the allocated memory didn;t contain wrapper header the pointer got corrupt when calling to free. This implementation of signature addition during malloc and signature check during free helps in freeing the memory allocated by wrapper functions properly and also the internal memory allocated by compilers (without malloc wrappers).
f949892
to
0e75879
Compare
@0xc0170 - Rebase done. Thanks |
Description
Compilers allocate some section of memory without using wrapper function, which is later freed when wrappers were initialized. Since the allocate memory didn;t contain wrapper header the pointer got corrupt when calling to free.
This implementation of signature addition during malloc and signature check during free helps in freeing the memory allocated by wrapper functions properly and also the internal memory allocated by compilers (without malloc wrappers).
Resolves: #7912
Pull request type