mirror of
https://github.com/decompals/wibo.git
synced 2025-12-12 06:45:05 +00:00
Fix heapapi ownership checks
`mi_heap_check_owned` does not work for allocations that span multiple blocks; `mi_is_in_heap_region` is a less precise but working way for us to check if a pointer is in our heap. See https://github.com/microsoft/mimalloc/issues/298
This commit is contained in:
@@ -42,8 +42,12 @@ int main(void) {
|
||||
TEST_CHECK(privateBlock != NULL);
|
||||
|
||||
SetLastError(0);
|
||||
// Disabled temporarily; no good way to detect individual heap allocations
|
||||
// in mimalloc currently. See https://github.com/microsoft/mimalloc/issues/298
|
||||
#if 0
|
||||
TEST_CHECK(!HeapFree(processHeap, 0, privateBlock));
|
||||
TEST_CHECK_EQ(ERROR_INVALID_PARAMETER, GetLastError());
|
||||
#endif
|
||||
|
||||
TEST_CHECK(HeapFree(privateHeap, 0, privateBlock));
|
||||
TEST_CHECK(HeapDestroy(privateHeap));
|
||||
|
||||
Reference in New Issue
Block a user