@@ -183,10 +183,9 @@ class Module final {
183
183
explicit Memory (std::vector<std::vector<uint8_t >>&& non_const_buffers)
184
184
: runtime_allocator_(),
185
185
non_const_buffers_(std::move(non_const_buffers)),
186
- non_const_allocator_list_(create_non_const_allocators ()),
186
+ non_const_spans_(create_non_const_spans ()),
187
187
non_const_allocator_(
188
- non_const_allocator_list_.size(),
189
- non_const_allocator_list_.data()),
188
+ {non_const_spans_.data (), non_const_spans_.size ()}),
190
189
mem_manager_(
191
190
&const_allocator_,
192
191
&non_const_allocator_,
@@ -211,17 +210,17 @@ class Module final {
211
210
212
211
std::vector<std::vector<uint8_t >> non_const_buffers_;
213
212
214
- std::vector<MemoryAllocator> non_const_allocator_list_ ;
213
+ std::vector<Span< uint8_t >> non_const_spans_ ;
215
214
216
215
HierarchicalAllocator non_const_allocator_;
217
216
218
217
MemoryManager mem_manager_;
219
218
220
- std::vector<MemoryAllocator> create_non_const_allocators () {
221
- std::vector<MemoryAllocator > result;
219
+ std::vector<Span< uint8_t >> create_non_const_spans () {
220
+ std::vector<Span< uint8_t > > result;
222
221
for (size_t i = 0 ; i < non_const_buffers_.size (); i++) {
223
- result.push_back (MemoryAllocator (
224
- non_const_buffers_[i].size (), non_const_buffers_[i].data ()) );
222
+ result.push_back (
223
+ { non_const_buffers_[i].data (), non_const_buffers_[i].size ()} );
225
224
}
226
225
return result;
227
226
}
0 commit comments