diff options
author | daan <daanl@outlook.com> | 2019-07-18 18:59:32 -0700 |
---|---|---|
committer | daan <daanl@outlook.com> | 2019-07-18 18:59:32 -0700 |
commit | c228ecefd8c183b5992aa9dd71922dff33a568b4 (patch) | |
tree | 1c15762c721b787a0ca59f7a61ad81501dadf8d1 /src/alloc-posix.c | |
parent | f646cc925dab5116a3677e9045cda169d9b9527c (diff) |
update for new dynamic direction on windows 64-bit
Diffstat (limited to 'src/alloc-posix.c')
-rw-r--r-- | src/alloc-posix.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/alloc-posix.c b/src/alloc-posix.c index b3185f1..3d28f65 100644 --- a/src/alloc-posix.c +++ b/src/alloc-posix.c @@ -80,3 +80,14 @@ void* mi_reallocarray( void* p, size_t count, size_t size ) mi_attr_noexcept { return newp; } +void* mi__expand(void* p, size_t newsize) mi_attr_noexcept { // Microsoft + void* res = mi_expand(p, newsize); + if (res == NULL) errno = ENOMEM; + return res; +} + +void* mi_recalloc(void* p, size_t count, size_t size) mi_attr_noexcept { // Microsoft + size_t total; + if (mi_mul_overflow(count, size, &total)) return NULL; + return _mi_heap_realloc_zero(mi_get_default_heap(), p, total, true); +} |