Rename zero_realloc option "strict" to "alloc".
With realloc(ptr, 0) being UB per C23, the option name "strict" makes less sense now. Rename to "alloc" which describes the behavior.
This commit is contained in:
@@ -24,7 +24,7 @@ deallocated() {
|
||||
return deallocated;
|
||||
}
|
||||
|
||||
TEST_BEGIN(test_realloc_strict) {
|
||||
TEST_BEGIN(test_realloc_alloc) {
|
||||
void *ptr = mallocx(1, 0);
|
||||
expect_ptr_not_null(ptr, "Unexpected mallocx error");
|
||||
uint64_t allocated_before = allocated();
|
||||
@@ -44,5 +44,5 @@ TEST_END
|
||||
int
|
||||
main(void) {
|
||||
return test(
|
||||
test_realloc_strict);
|
||||
test_realloc_alloc);
|
||||
}
|
3
test/unit/zero_realloc_alloc.sh
Normal file
3
test/unit/zero_realloc_alloc.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
export MALLOC_CONF="zero_realloc:alloc"
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export MALLOC_CONF="zero_realloc:strict"
|
Reference in New Issue
Block a user