egg-secure-memory: Allocate enough space for the guard pointers
-
egg-secure-memory: Allocate enough space for the guard pointers
Cell allocations have an overhead of two pointer-sized words, which we need to take into account. Otherwise, whenever we try to allocate a new block to hold at least
DEFAULT_BLOCK_SIZE - 2 * sizeof (void *)
bytes, it will end up too small to allocate a cell of that size and we will fall back to non-mlock'd memory with a warning.Fixes: 982aadd9 "Completely overhaul the secure memory allocator"
Resolves: #36 -
egg-secure-memory: Add a warning if #36 happens again
If we call sec_block_create() to allocate a block sized to hold
length
bytes, and we succeed, then we should really be able to sec_alloc() a cell oflength
bytes within that block. If we can't, then we chose the size of the block incorrectly.