Add Leak Detection to Ona Heap Allocator #15
|
@ -58,7 +58,7 @@ const Context = struct {
|
|||
const target_allocation_info = @intToPtr(*AllocationInfo, @ptrToInt(allocation.ptr) - @sizeOf(AllocationInfo));
|
||||
|
||||
if (target_allocation_info.size != allocation.len) {
|
||||
@panic("incorrect allocation length");
|
||||
@panic("incorrect allocation length for deallocating");
|
||||
}
|
||||
|
||||
if (self.allocation_info_head) |allocation_info_head| {
|
||||
|
@ -87,7 +87,7 @@ const Context = struct {
|
|||
}
|
||||
}
|
||||
|
||||
@panic("double-free detected");
|
||||
@panic("incorrect allocation address for deallocating");
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -110,7 +110,7 @@ const Context = struct {
|
|||
const target_allocation_info = @intToPtr(*AllocationInfo, @ptrToInt(allocation.ptr) - allocation_info_size);
|
||||
|
||||
if (target_allocation_info.size != allocation.len) {
|
||||
@panic("incorrect allocation length");
|
||||
@panic("incorrect allocation length for reallocating");
|
||||
}
|
||||
|
||||
if (self.allocation_info_head) |allocation_info_head| {
|
||||
|
@ -139,7 +139,7 @@ const Context = struct {
|
|||
}
|
||||
}
|
||||
|
||||
@panic("use-after-free detected");
|
||||
@panic("incorrect allocation address for reallocating");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue