54
54
#endif
55
55
56
56
namespace arrow {
57
-
58
- namespace memory_pool {
59
-
60
- namespace internal {
57
+ namespace memory_pool ::internal {
61
58
62
59
alignas (kDefaultBufferAlignment ) int64_t zero_size_area[1 ] = {kDebugXorSuffix };
63
60
64
- } // namespace internal
65
-
66
- } // namespace memory_pool
61
+ } // namespace memory_pool::internal
67
62
68
63
namespace {
69
64
@@ -394,15 +389,15 @@ class MimallocAllocator {
394
389
*out = memory_pool::internal::kZeroSizeArea ;
395
390
return Status::OK ();
396
391
}
397
- *out = reinterpret_cast <uint8_t *>(
398
- mi_malloc_aligned ( static_cast <size_t >(size), static_cast <size_t >(alignment)));
392
+ *out = reinterpret_cast <uint8_t *>(arrow_mi_malloc_aligned (
393
+ static_cast <size_t >(size), static_cast <size_t >(alignment)));
399
394
if (*out == NULL ) {
400
395
return Status::OutOfMemory (" malloc of size " , size, " failed" );
401
396
}
402
397
return Status::OK ();
403
398
}
404
399
405
- static void ReleaseUnused () { mi_collect (true ); }
400
+ static void ReleaseUnused () { arrow_mi_collect (true ); }
406
401
407
402
static Status ReallocateAligned (int64_t old_size, int64_t new_size, int64_t alignment,
408
403
uint8_t ** ptr) {
@@ -417,7 +412,7 @@ class MimallocAllocator {
417
412
return Status::OK ();
418
413
}
419
414
*ptr = reinterpret_cast <uint8_t *>(
420
- mi_realloc_aligned (previous_ptr, static_cast <size_t >(new_size), alignment));
415
+ arrow_mi_realloc_aligned (previous_ptr, static_cast <size_t >(new_size), alignment));
421
416
if (*ptr == NULL ) {
422
417
*ptr = previous_ptr;
423
418
return Status::OutOfMemory (" realloc of size " , new_size, " failed" );
@@ -429,7 +424,7 @@ class MimallocAllocator {
429
424
if (ptr == memory_pool::internal::kZeroSizeArea ) {
430
425
DCHECK_EQ (size, 0 );
431
426
} else {
432
- mi_free (ptr);
427
+ arrow_mi_free (ptr);
433
428
}
434
429
}
435
430
};
0 commit comments