diff options
author | daan <daan@effp.org> | 2022-10-28 19:54:56 -0700 |
---|---|---|
committer | daan <daan@effp.org> | 2022-10-28 19:54:56 -0700 |
commit | 6eeb81ee05972ea5126ff03a28bea89249f218cf (patch) | |
tree | 16dfe789ef2da274c5fcfa59fe6357ed567fa002 /include/mimalloc-internal.h | |
parent | eb29d6b06f0f0d38aa8d7edd036d1dc412395393 (diff) |
initial progress on valgrind integration
Diffstat (limited to 'include/mimalloc-internal.h')
-rw-r--r-- | include/mimalloc-internal.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h index 9fa3710..c1716b4 100644 --- a/include/mimalloc-internal.h +++ b/include/mimalloc-internal.h @@ -9,6 +9,7 @@ terms of the MIT license. A copy of the license can be found in the file #define MIMALLOC_INTERNAL_H #include "mimalloc-types.h" +#include "mimalloc-track.h" #if (MI_DEBUG>0) #define mi_trace_message(...) _mi_trace_message(__VA_ARGS__) @@ -625,21 +626,27 @@ static inline mi_encoded_t mi_ptr_encode(const void* null, const void* p, const } static inline mi_block_t* mi_block_nextx( const void* null, const mi_block_t* block, const uintptr_t* keys ) { + MI_TRACK_MEM_DEFINED(block,sizeof(mi_block_t)); + mi_block_t* next; #ifdef MI_ENCODE_FREELIST - return (mi_block_t*)mi_ptr_decode(null, block->next, keys); + next = (mi_block_t*)mi_ptr_decode(null, block->next, keys); #else MI_UNUSED(keys); MI_UNUSED(null); - return (mi_block_t*)block->next; + next = (mi_block_t*)block->next; #endif + MI_TRACK_MEM_NOACCESS(block,sizeof(mi_block_t)); + return next; } static inline void mi_block_set_nextx(const void* null, mi_block_t* block, const mi_block_t* next, const uintptr_t* keys) { + MI_TRACK_MEM_UNDEFINED(block,sizeof(mi_block_t)); #ifdef MI_ENCODE_FREELIST block->next = mi_ptr_encode(null, next, keys); #else MI_UNUSED(keys); MI_UNUSED(null); block->next = (mi_encoded_t)next; #endif + MI_TRACK_MEM_NOACCESS(block,sizeof(mi_block_t)); } static inline mi_block_t* mi_block_next(const mi_page_t* page, const mi_block_t* block) { |