slightly improve sized deallocation error messages
parent
dcd969ae04
commit
3dc49f8f73
4
malloc.c
4
malloc.c
|
@ -411,7 +411,7 @@ static inline void deallocate_small(void *p, size_t *expected_size) {
|
||||||
struct size_class *c = &size_class_metadata[class];
|
struct size_class *c = &size_class_metadata[class];
|
||||||
size_t size = size_classes[class];
|
size_t size = size_classes[class];
|
||||||
if (expected_size && size != *expected_size) {
|
if (expected_size && size != *expected_size) {
|
||||||
fatal_error("sized deallocation mismatch");
|
fatal_error("sized deallocation mismatch (small)");
|
||||||
}
|
}
|
||||||
bool is_zero_size = size == 0;
|
bool is_zero_size = size == 0;
|
||||||
if (is_zero_size) {
|
if (is_zero_size) {
|
||||||
|
@ -767,7 +767,7 @@ static void deallocate_large(void *p, size_t *expected_size) {
|
||||||
}
|
}
|
||||||
size_t size = region->size;
|
size_t size = region->size;
|
||||||
if (expected_size && size != *expected_size) {
|
if (expected_size && size != *expected_size) {
|
||||||
fatal_error("sized deallocation mismatch");
|
fatal_error("sized deallocation mismatch (large)");
|
||||||
}
|
}
|
||||||
size_t guard_size = region->guard_size;
|
size_t guard_size = region->guard_size;
|
||||||
regions_delete(region);
|
regions_delete(region);
|
||||||
|
|
Loading…
Reference in New Issue