fix build warnings on linux

This commit is contained in:
daan 2020-01-19 17:33:36 -08:00
parent 41e717c2e0
commit e8d7c80c74
2 changed files with 10 additions and 10 deletions

View file

@ -94,7 +94,7 @@ void _mi_block_zero_init(const mi_page_t* page, void* p, size_t size) {
// or the recalloc/rezalloc functions cannot safely expand in place (see issue #63) // or the recalloc/rezalloc functions cannot safely expand in place (see issue #63)
UNUSED_RELEASE(size); UNUSED_RELEASE(size);
mi_assert_internal(p != NULL); mi_assert_internal(p != NULL);
mi_assert_internal(size >= 0 && mi_page_block_size(page) >= size); mi_assert_internal(mi_page_block_size(page) >= size); // size can be zero
mi_assert_internal(_mi_ptr_page(p)==page); mi_assert_internal(_mi_ptr_page(p)==page);
if (page->is_zero) { if (page->is_zero) {
// already zero initialized memory? // already zero initialized memory?

View file

@ -93,7 +93,7 @@ int main() {
result = (mi_calloc((size_t)&mi_calloc,SIZE_MAX/1000) == NULL); result = (mi_calloc((size_t)&mi_calloc,SIZE_MAX/1000) == NULL);
}); });
CHECK_BODY("calloc0",{ CHECK_BODY("calloc0",{
result = (mi_usable_size(mi_calloc(0,1000)) >= 0); result = (mi_usable_size(mi_calloc(0,1000)) <= 16);
}); });
// --------------------------------------------------- // ---------------------------------------------------