Skip to content

Commit ee39417

Browse files
committed
Refine memory buffer for importing shared cache objc class list
In https://reviews.llvm.org/D118972 I increased this buffer to be big enough to import 261,144 classes but this is a lot more than we currently have, an allocating a too-large buffer can add memory pressure even if it's only for a short time. Reduce the size of this memory buffer to big enough to import 163,840 classes. I'll probably move to a scheme where we read the objc classes in chunks, with a smaller buffer and multiple inferior function calls. rdar://91275493
1 parent 7c53fc4 commit ee39417

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,8 @@ AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap() {
20102010
return DescriptorMapUpdateResult::Fail();
20112011

20122012
// The number of entries to pre-allocate room for.
2013-
const uint32_t max_num_classes = 256 * 1024;
2013+
// Each entry is (addrsize + 4) bytes
2014+
const uint32_t max_num_classes = 163840;
20142015

20152016
UtilityFunction *get_class_info_code = GetClassInfoUtilityFunction(exe_ctx);
20162017
if (!get_class_info_code) {

0 commit comments

Comments
 (0)