add configuration for canaries

This commit is contained in:
Daniel Micay 2018-09-07 00:35:08 -04:00
parent 96c538d90f
commit fc2473e7ee
2 changed files with 2 additions and 1 deletions

View File

@ -5,5 +5,6 @@
#define WRITE_AFTER_FREE_CHECK true
#define SLOT_RANDOMIZE true
#define ZERO_ON_FREE true
#define SLAB_CANARY true
#endif

View File

@ -23,7 +23,7 @@ static_assert(sizeof(void *) == 8, "64-bit only");
static_assert(!WRITE_AFTER_FREE_CHECK || ZERO_ON_FREE, "WRITE_AFTER_FREE_CHECK depends on ZERO_ON_FREE");
// either sizeof(uint64_t) or 0
static const size_t canary_size = sizeof(uint64_t);
static const size_t canary_size = SLAB_CANARY ? sizeof(uint64_t) : 0;
#define CACHELINE_SIZE 64