#endif
ralloc_header
{
-#ifdef DEBUG
+#ifndef NDEBUG
/* A canary value used to determine whether a pointer is ralloc'd. */
unsigned canary;
#endif
{
ralloc_header *info = (ralloc_header *) (((char *) ptr) -
sizeof(ralloc_header));
-#ifdef DEBUG
assert(info->canary == CANARY);
-#endif
return info;
}
add_child(parent, info);
-#ifdef DEBUG
+#ifndef NDEBUG
info->canary = CANARY;
#endif
#define LMAGIC 0x87b9c7d3
struct linear_header {
-#ifdef DEBUG
+#ifndef NDEBUG
unsigned magic; /* for debugging */
#endif
unsigned offset; /* points to the first unused byte in the buffer */
if (unlikely(!node))
return NULL;
-#ifdef DEBUG
+#ifndef NDEBUG
node->magic = LMAGIC;
#endif
node->offset = 0;
linear_size_chunk *ptr;
unsigned full_size;
-#ifdef DEBUG
assert(first->magic == LMAGIC);
-#endif
assert(!latest->next);
size = ALIGN_POT(size, SUBALLOC_ALIGNMENT);
return;
node = LINEAR_PARENT_TO_HEADER(ptr);
-#ifdef DEBUG
assert(node->magic == LMAGIC);
-#endif
while (node) {
void *ptr = node;
return;
node = LINEAR_PARENT_TO_HEADER(ptr);
-#ifdef DEBUG
assert(node->magic == LMAGIC);
-#endif
while (node) {
ralloc_steal(new_ralloc_ctx, node);
ralloc_parent_of_linear_parent(void *ptr)
{
linear_header *node = LINEAR_PARENT_TO_HEADER(ptr);
-#ifdef DEBUG
assert(node->magic == LMAGIC);
-#endif
return node->ralloc_parent;
}