diff options
author | Daan <daan@microsoft.com> | 2021-12-15 16:27:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 16:27:26 -0800 |
commit | 1b09877bc46a14e7856d3295aa599506ebb857dc (patch) | |
tree | c7b7ab9f609ac92d9e82c0bb2344c276aab86343 /src/alloc-posix.c | |
parent | d6a56dd99d5abe4e1f6af555976ee8dc64e1ec8a (diff) | |
parent | 523e6d5c9b251bc8d969a685b2b6feda6fd1f8ab (diff) |
Merge branch 'dev' into netbsd_reallocarr
Diffstat (limited to 'src/alloc-posix.c')
-rw-r--r-- | src/alloc-posix.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/alloc-posix.c b/src/alloc-posix.c index 6465304..6627d2b 100644 --- a/src/alloc-posix.c +++ b/src/alloc-posix.c @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Copyright (c) 2018,2019, Microsoft Research, Daan Leijen +Copyright (c) 2018-2021, Microsoft Research, Daan Leijen This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. @@ -33,13 +33,19 @@ terms of the MIT license. A copy of the license can be found in the file size_t mi_malloc_size(const void* p) mi_attr_noexcept { + //if (!mi_is_in_heap_region(p)) return 0; return mi_usable_size(p); } size_t mi_malloc_usable_size(const void *p) mi_attr_noexcept { + //if (!mi_is_in_heap_region(p)) return 0; return mi_usable_size(p); } +size_t mi_malloc_good_size(size_t size) mi_attr_noexcept { + return mi_good_size(size); +} + void mi_cfree(void* p) mi_attr_noexcept { if (mi_is_in_heap_region(p)) { mi_free(p); |