Skip to content

Commit eb3df4c

Browse files
committed
[executorch] Migrate ExecutorchModule.mm to use the new HierarchicalAllocator span ctor
Stop using the deprecated HierarchicalAllocator ctor. Differential Revision: [D49344927](https://our.internmc.facebook.com/intern/diff/D49344927/) ghstack-source-id: 200970946 Pull Request resolved: #391
1 parent 8a67c4d commit eb3df4c

File tree

1 file changed

+2
-6
lines changed
  • examples/ios_demo_apps/ExecutorchMobileNet/ExecutorchMobileNet/ExecutorchMobileNet

1 file changed

+2
-6
lines changed

examples/ios_demo_apps/ExecutorchMobileNet/ExecutorchMobileNet/ExecutorchMobileNet/ExecutorchModule.mm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,8 @@ - (char*)segmentImage:(void*)imageBuffer
162162
MemoryAllocator temp_allocator{MemoryAllocator(0, nullptr)};
163163
temp_allocator.enable_profiling("temp allocator");
164164

165-
MemoryAllocator non_const_allocators[1]{
166-
MemoryAllocator(kMemoryAmount, activation_pool)};
167-
non_const_allocators[0].enable_profiling("non_const_allocators");
168-
169-
HierarchicalAllocator non_const_allocator{
170-
HierarchicalAllocator(1, non_const_allocators)};
165+
Span<uint8_t> non_const_buffers[1]{{activation_pool, kMemoryAmount}};
166+
HierarchicalAllocator non_const_allocator({non_const_buffers, 1});
171167

172168
MemoryManager memory_manager{MemoryManager(
173169
&const_allocator,

0 commit comments

Comments
 (0)