return;
info = get_header(ptr);
- parent = get_header(new_ctx);
+ parent = new_ctx ? get_header(new_ctx) : NULL;
unlink_block(info);
* other buffers.
*/
-#define ALIGN_POT(x, y) (((x) + (y) - 1) & ~((y) - 1))
-
#define MIN_LINEAR_BUFSIZE 2048
#define SUBALLOC_ALIGNMENT sizeof(uintptr_t)
#define LMAGIC 0x87b9c7d3
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;
}