Skip to content

Commit f726b25

Browse files
committed
Add utils_annotate_memory_inaccessible
1 parent 4d21278 commit f726b25

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/base_alloc/base_alloc_global.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,12 @@ void umf_ba_global_free(void *ptr) {
195195

196196
int ac_index = size_to_idx(total_size);
197197
if (ac_index >= NUM_ALLOCATION_CLASSES) {
198-
utils_annotate_memory_inaccessible(ptr, total_size);
199198
ba_os_free(ptr, total_size);
200199
return;
201200
}
202201

203202
if (!BASE_ALLOC.ac[ac_index]) {
204203
// if creating ac failed, memory must have been allocated by os
205-
utils_annotate_memory_inaccessible(ptr, total_size);
206204
ba_os_free(ptr, total_size);
207205
return;
208206
}

src/base_alloc/base_alloc_linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void *ba_os_alloc(size_t size) {
2929
}
3030

3131
void ba_os_free(void *ptr, size_t size) {
32+
utils_annotate_memory_inaccessible(ptr, size);
3233
int ret = munmap(ptr, size);
3334
assert(ret == 0);
3435
(void)ret; // unused

src/provider/provider_os_memory_posix.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ void *os_mmap(void *hint_addr, size_t length, int prot, int flag, int fd,
8282
return ptr;
8383
}
8484

85-
int os_munmap(void *addr, size_t length) { return munmap(addr, length); }
85+
int os_munmap(void *addr, size_t length) {
86+
return munmap(addr, length);
87+
}
8688

8789
size_t os_get_page_size(void) { return sysconf(_SC_PAGE_SIZE); }
8890

0 commit comments

Comments
 (0)