Clarify panic wording in Ona heap implementation

This commit is contained in:
kayomn 2023-06-04 12:34:48 +00:00
parent 331d862246
commit 9c871aac97
1 changed files with 4 additions and 4 deletions

View File

@ -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");
}
};