Clarify panic wording in Ona heap implementation
This commit is contained in:
parent
331d862246
commit
9c871aac97
|
@ -58,7 +58,7 @@ const Context = struct {
|
||||||
const target_allocation_info = @intToPtr(*AllocationInfo, @ptrToInt(allocation.ptr) - @sizeOf(AllocationInfo));
|
const target_allocation_info = @intToPtr(*AllocationInfo, @ptrToInt(allocation.ptr) - @sizeOf(AllocationInfo));
|
||||||
|
|
||||||
if (target_allocation_info.size != allocation.len) {
|
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| {
|
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);
|
const target_allocation_info = @intToPtr(*AllocationInfo, @ptrToInt(allocation.ptr) - allocation_info_size);
|
||||||
|
|
||||||
if (target_allocation_info.size != allocation.len) {
|
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| {
|
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