summaryrefslogtreecommitdiff
path: root/source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-12-01 13:43:10 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-12-01 13:43:10 +0100
commit08fa92c1c94d9faddee48590a1a20506e89c191c (patch)
tree12bbf6fa56b69c47340d4c15f8f601be2d9487b5 /source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h
parent2593c827482f6c5a315d504cd5316879d6172656 (diff)
downloadcontext-08fa92c1c94d9faddee48590a1a20506e89c191c.tar.gz
2022-12-01 12:41:00
Diffstat (limited to 'source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h')
-rw-r--r--source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h b/source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h
index fb75ea464..1387a7200 100644
--- a/source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h
+++ b/source/luametatex/source/libraries/mimalloc/include/mimalloc-types.h
@@ -29,6 +29,9 @@ terms of the MIT license. A copy of the license can be found in the file
// Define NDEBUG in the release version to disable assertions.
// #define NDEBUG
+// Define MI_VALGRIND to enable valgrind support
+// #define MI_VALGRIND 1
+
// Define MI_STAT as 1 to maintain statistics; set it to 2 to have detailed statistics (but costs some performance).
// #define MI_STAT 1
@@ -56,14 +59,14 @@ terms of the MIT license. A copy of the license can be found in the file
// Reserve extra padding at the end of each block to be more resilient against heap block overflows.
// The padding can detect byte-precise buffer overflow on free.
-#if !defined(MI_PADDING) && (MI_DEBUG>=1)
+#if !defined(MI_PADDING) && (MI_DEBUG>=1 || MI_VALGRIND)
#define MI_PADDING 1
#endif
// Encoded free lists allow detection of corrupted free lists
// and can detect buffer overflows, modify after free, and double `free`s.
-#if (MI_SECURE>=3 || MI_DEBUG>=1 || MI_PADDING > 0)
+#if (MI_SECURE>=3 || MI_DEBUG>=1)
#define MI_ENCODE_FREELIST 1
#endif
@@ -435,6 +438,7 @@ struct mi_heap_s {
mi_page_queue_t pages[MI_BIN_FULL + 1]; // queue of pages for each size class (or "bin")
_Atomic(mi_block_t*) thread_delayed_free;
mi_threadid_t thread_id; // thread this heap belongs too
+ mi_arena_id_t arena_id; // arena id if the heap belongs to a specific arena (or 0)
uintptr_t cookie; // random cookie to verify pointers (see `_mi_ptr_cookie`)
uintptr_t keys[2]; // two random keys used to encode the `thread_delayed_free` list
mi_random_ctx_t random; // random number context used for secure allocation