// Standard imports
import cstring = tango.stdc.string;
+import cstdlib = tango.stdc.stdlib;
// Debug imports
this.live_list.unlink(cell);
if (cell.has_finalizer)
rt_finalize(cell.ptr, false);
+ // Set the pattern to detect corruption
+ cstring.memset(cell.ptr, 0xca, cell.capacity);
this.free_list.link(cell);
}
}
return null;
reuse:
+ // Check the pattern to detect corruption
+ for (size_t i = 0; i < cell.capacity; ++i)
+ if ((cast(ubyte*) cell.ptr)[i] != 0xca)
+ cstdlib.abort();
cell.size = size;
cell.attr = cast(BlkAttr) attr;
auto cell = Cell.alloc(size);
if (cell is null)
return 0;
+ // Set the pattern to detect corruption
+ cstring.memset(cell.ptr, 0xca, cell.capacity);
this.free_list.link(cell);
return cell.capacity;
}