Skip to content

Commit dea872c

Browse files
dbortfacebook-github-bot
authored andcommitted
Migrate ExecutorchModule.mm to use the new HierarchicalAllocator span ctor (#391)
Summary: Pull Request resolved: #391 Stop using the deprecated HierarchicalAllocator ctor. ghstack-source-id: 201128786 exported-using-ghexport Reviewed By: tarun292 Differential Revision: D49344927 fbshipit-source-id: 8b9b9f00d6c15984f119a680b4393fb9197a4038
1 parent 2c97516 commit dea872c

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)