MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / mem2chunk

Function mem2chunk

libCacheSim/dataStructure/sparsepp/spp_dlalloc.h:777–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775// conversion from malloc headers to user pointers, and back
776static SPP_FORCEINLINE void *chunk2mem(const void *p) { return (void *)((char *)p + 2 * sizeof(size_t)); }
777static SPP_FORCEINLINE mchunkptr mem2chunk(const void *mem) { return (mchunkptr)((char *)mem - 2 * sizeof(size_t)); }
778
779// chunk associated with aligned address A
780static SPP_FORCEINLINE mchunkptr align_as_chunk(char *A) { return (mchunkptr)(A + align_offset(chunk2mem(A))); }

Callers 11

sys_allocMethod · 0.85
internal_memalignMethod · 0.85
iallocMethod · 0.85
internal_bulk_freeMethod · 0.85
initMethod · 0.85
mspace_freeFunction · 0.85
mspace_callocFunction · 0.85
mspace_reallocFunction · 0.85
mspace_realloc_in_placeFunction · 0.85
mspace_usable_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected