11/*
2- * Copyright (C) 2024 Intel Corporation
2+ * Copyright (C) 2024-2025 Intel Corporation
33 *
44 * Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
55 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66*/
77
88#include <assert.h>
9- #include <stdio.h>
109#include <sys/mman.h>
11- #include <sys/syscall.h>
1210#include <unistd.h>
1311
14- #include "base_alloc.h"
15- #include "base_alloc_global.h"
1612#include "utils_concurrency.h"
1713
1814static UTIL_ONCE_FLAG Page_size_is_initialized = UTIL_ONCE_FLAG_INIT ;
1915static size_t Page_size ;
2016
2117void * ba_os_alloc (size_t size ) {
22- void * ptr = mmap (NULL , size , PROT_READ | PROT_WRITE ,
23- MAP_PRIVATE | MAP_ANONYMOUS , -1 , 0 );
18+ void * ptr = utils_mmap (NULL , size , PROT_READ | PROT_WRITE ,
19+ MAP_PRIVATE | MAP_ANONYMOUS , -1 , 0 );
2420 // this should be unnecessary but pairs of mmap/munmap do not reset
2521 // asan's user-poisoning flags, leading to invalid error reports
2622 // Bug 81619: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81619
@@ -29,7 +25,7 @@ void *ba_os_alloc(size_t size) {
2925}
3026
3127void ba_os_free (void * ptr , size_t size ) {
32- int ret = munmap (ptr , size );
28+ int ret = utils_munmap (ptr , size );
3329 assert (ret == 0 );
3430 (void )ret ; // unused
3531}
0 commit comments