[compiler-rt] 3a4f471 - [compiler-rt][Fuchsia] Use map name if provided

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 13:39:48 PDT 2023


Author: Leonard Chan
Date: 2023-08-22T20:38:45Z
New Revision: 3a4f471b11ff2dacd1d740d14b073e15dbc04f42

URL: https://github.com/llvm/llvm-project/commit/3a4f471b11ff2dacd1d740d14b073e15dbc04f42
DIFF: https://github.com/llvm/llvm-project/commit/3a4f471b11ff2dacd1d740d14b073e15dbc04f42.diff

LOG: [compiler-rt][Fuchsia] Use map name if provided

Prior to this, any allocations coming from the SizeClassAllocator would just
have the vmo name "SizeClassAllocator". This will instead use the string passed
to the Map functions if provided which provide slightly more info on what the
vmo is used for. That is, is it for region data, metadata, or freearray space.

Differential Revision: https://reviews.llvm.org/D158537

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
index 1e25265c00a205..0245164403c51d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
@@ -226,13 +226,14 @@ static uptr DoMmapFixedOrDie(zx_handle_t vmar, uptr fixed_addr, uptr map_size,
 
 uptr ReservedAddressRange::Map(uptr fixed_addr, uptr map_size,
                                const char *name) {
-  return DoMmapFixedOrDie(os_handle_, fixed_addr, map_size, base_, name_,
-                          false);
+  return DoMmapFixedOrDie(os_handle_, fixed_addr, map_size, base_,
+                          name ? name : name_, false);
 }
 
 uptr ReservedAddressRange::MapOrDie(uptr fixed_addr, uptr map_size,
                                     const char *name) {
-  return DoMmapFixedOrDie(os_handle_, fixed_addr, map_size, base_, name_, true);
+  return DoMmapFixedOrDie(os_handle_, fixed_addr, map_size, base_,
+                          name ? name : name_, true);
 }
 
 void UnmapOrDieVmar(void *addr, uptr size, zx_handle_t target_vmar) {


        


More information about the llvm-commits mailing list