File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ void chunk_manager_metadata_t::synchronize_allocation_metadata()
148148
149149void chunk_manager_metadata_t::clear ()
150150{
151+ // NB: We cannot clear the chunk state and version!
151152 shared_lock.clear ();
152153 last_allocation_metadata.store ({});
153154 std::fill (allocated_slots_bitmap, allocated_slots_bitmap + c_slot_bitmap_size_in_words, 0 );
Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ chunk_offset_t memory_manager_t::allocate_unused_chunk()
103103
104104 // Now try to claim this chunk.
105105 chunk_manager_t chunk_manager;
106- chunk_manager.initialize (allocated_chunk_offset);
106+ // NB: We cannot call initialize() here because we don't own the chunk yet!
107+ chunk_manager.load (allocated_chunk_offset);
107108 // REVIEW: the memory manager should call
108109 // update_chunk_allocation_status() directly instead of delegating
109110 // it to chunk_manager_t::allocate_chunk().
@@ -153,7 +154,8 @@ chunk_offset_t memory_manager_t::allocate_used_chunk()
153154
154155 auto available_chunk_offset = static_cast <chunk_offset_t >(found_index);
155156 chunk_manager_t chunk_manager;
156- chunk_manager.initialize (available_chunk_offset);
157+ // NB: We cannot call initialize() here because we don't own the chunk yet!
158+ chunk_manager.load (available_chunk_offset);
157159 // REVIEW: the memory manager should call
158160 // update_chunk_allocation_status() directly instead of delegating
159161 // it to chunk_manager_t::allocate_chunk().
You can’t perform that action at this time.
0 commit comments