[llvm] [ORC] Add opt-in per-JITDylib colocating slab allocator (PR #207970)

Jared Wyles via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 20:09:42 PDT 2026


================
@@ -423,6 +424,31 @@ class LLJITBuilderSetters {
     return impl();
   }
 
+  /// Use an in-process, per-JITDylib-colocating slab allocator as the JIT's
+  /// memory manager (see
+  /// MapperJITLinkMemoryManager::CreateColocatingInProcess). Keeping a
+  /// JITDylib's objects colocated lets them reference each other with direct
+  /// (e.g. 32-bit PC-relative) edges. If ReservationGranularity is not given,
+  /// MapperJITLinkMemoryManager::defaultSlabSize() is used.
+  ///
+  /// Note: this only takes effect on the JITLink path. On targets that still
+  /// default to RuntimeDyld (e.g. COFF today) it has no effect unless JITLink
+  /// is also enabled (e.g. via setObjectLinkingLayerCreator).
+  SetterImpl &setColocatingSlabAllocator(
----------------
jaredwy wrote:

I think this should take a policy, and default to single in its absence. 

https://github.com/llvm/llvm-project/pull/207970


More information about the llvm-commits mailing list