diff --git a/src/mem/allocconfig.h b/src/mem/allocconfig.h index f80690b..ec38b90 100644 --- a/src/mem/allocconfig.h +++ b/src/mem/allocconfig.h @@ -4,12 +4,6 @@ namespace snmalloc { - enum ZeroMem - { - NoZero, - YesZero - }; - // 0 intermediate bits results in power of 2 small allocs. 1 intermediate // bit gives additional sizeclasses at the midpoint between each power of 2. // 2 intermediate bits gives 3 intermediate sizeclasses, etc. diff --git a/src/pal/pal_consts.h b/src/pal/pal_consts.h index 5e14a7f..7cb40d9 100644 --- a/src/pal/pal_consts.h +++ b/src/pal/pal_consts.h @@ -27,4 +27,19 @@ namespace snmalloc */ AlignedAllocation = (1 << 1) }; + /** + * Flag indicating whether requested memory should be zeroed. + */ + enum ZeroMem + { + /** + * Memory should not be zeroed, contents are undefined. + */ + NoZero, + /** + * Memory must be zeroed. This can be lazily allocated via a copy-on-write + * mechanism as long as any load from the memory returns zero. + */ + YesZero + }; }