use wrapper for calling memory_map_mte
parent
aa950244f8
commit
9739cb4690
19
h_malloc.c
19
h_malloc.c
|
@ -94,6 +94,15 @@ static inline bool is_memtag_enabled(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void *memory_map_tagged(size_t size) {
|
||||||
|
#ifdef HAS_ARM_MTE
|
||||||
|
if (likely51(is_memtag_enabled())) {
|
||||||
|
return memory_map_mte(size);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return memory_map(size);
|
||||||
|
}
|
||||||
|
|
||||||
#define SLAB_METADATA_COUNT
|
#define SLAB_METADATA_COUNT
|
||||||
|
|
||||||
struct slab_metadata {
|
struct slab_metadata {
|
||||||
|
@ -1242,15 +1251,7 @@ COLD static void init_slow_path(void) {
|
||||||
if (unlikely(memory_protect_rw_metadata(ra->regions, ra->total * sizeof(struct region_metadata)))) {
|
if (unlikely(memory_protect_rw_metadata(ra->regions, ra->total * sizeof(struct region_metadata)))) {
|
||||||
fatal_error("failed to unprotect memory for regions table");
|
fatal_error("failed to unprotect memory for regions table");
|
||||||
}
|
}
|
||||||
#ifdef HAS_ARM_MTE
|
ro.slab_region_start = memory_map_tagged(slab_region_size);
|
||||||
if (likely51(is_memtag_enabled())) {
|
|
||||||
ro.slab_region_start = memory_map_mte(slab_region_size);
|
|
||||||
} else {
|
|
||||||
ro.slab_region_start = memory_map(slab_region_size);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
ro.slab_region_start = memory_map(slab_region_size);
|
|
||||||
#endif
|
|
||||||
if (unlikely(ro.slab_region_start == NULL)) {
|
if (unlikely(ro.slab_region_start == NULL)) {
|
||||||
fatal_error("failed to allocate slab region");
|
fatal_error("failed to allocate slab region");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue