add nodiscard annotations to fix warnings in msvc

This commit is contained in:
Daan Leijen 2022-04-19 10:10:10 -07:00
parent e1b27a0fc2
commit 5b172280b0
4 changed files with 74 additions and 39 deletions

View file

@ -189,7 +189,7 @@ mi_heap_t* mi_heap_get_backing(void) {
return bheap;
}
mi_heap_t* mi_heap_new(void) {
mi_decl_nodiscard mi_heap_t* mi_heap_new(void) {
mi_heap_t* bheap = mi_heap_get_backing();
mi_heap_t* heap = mi_heap_malloc_tp(bheap, mi_heap_t); // todo: OS allocate in secure mode?
if (heap==NULL) return NULL;