mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
rearrange STL allocator code: remove pragma, ifdef for C++11
This commit is contained in:
parent
2d54553b7a
commit
7a9502973d
4 changed files with 25 additions and 35 deletions
|
@ -443,12 +443,7 @@ mi_decl_allocator void* mi_calloc(size_t count, size_t size) mi_attr_noexcept {
|
|||
// Uninitialized `calloc`
|
||||
extern mi_decl_allocator void* mi_heap_mallocn(mi_heap_t* heap, size_t count, size_t size) mi_attr_noexcept {
|
||||
size_t total;
|
||||
if (count==1) {
|
||||
total = size;
|
||||
}
|
||||
else if (mi_mul_overflow(count, size, &total)) {
|
||||
return NULL;
|
||||
}
|
||||
if (mi_mul_overflow(count, size, &total)) return NULL;
|
||||
return mi_heap_malloc(heap, total);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue