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

Signature to track memory allocations by wrapper functions #8062

Merged
merged 2 commits into from
Oct 15, 2018

Commits on Oct 8, 2018

  1. Alignment of 8 is not required for additional header

    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.
    Deepika committed Oct 8, 2018
    Configuration menu
    Copy the full SHA
    6646323 View commit details
    Browse the repository at this point in the history
  2. Signature to track memory allocations by wrapper functions.

    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).
    deepikabhavnani committed Oct 8, 2018
    Configuration menu
    Copy the full SHA
    0e75879 View commit details
    Browse the repository at this point in the history