History

Altered API getting the allocation from a vm_alloc_t. Added preliminary internal file descriptor type. Test groups now print out their name.

arr committed 10 years ago

Commit 5a417ba1 parent 9881f459 files · +230 −104Browse files

Showing the changes to src/vm/vm_memory.cpp (1 of 9 files). Show all

Unified · Split

src/vm/vm_memory.cpp+5−5
@@ -230,7 +230,7 @@ vm_alloc_t *vm_alloc_t::allocate(std::shared_ptr<const type_descriptor_t> td) · 229 unmodified lines
230230 auto alloc = ::new(mem)vm_alloc_t{ td };
231231
232232 // Initialize pointer types
233− init_memory(*td, alloc->allocation());
233+ init_memory(*td, alloc->get_allocation());
234234
235235 debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: vm alloc: %d\n", td->size_in_bytes);
236236 return alloc;
@@ -255,10 +255,10 @@ vm_alloc_t *vm_alloc_t::copy(const vm_alloc_t &other) · 18 unmodified lines
255255 auto alloc_copy = vm_alloc_t::allocate(other.alloc_type);
256256
257257 // Copy the current memory contents of the allocation
258− std::memcpy(alloc_copy->allocation(), other.allocation(), alloc_copy->alloc_type->size_in_bytes);
258+ std::memcpy(alloc_copy->get_allocation(), other.get_allocation(), alloc_copy->alloc_type->size_in_bytes);
259259
260260 // Ref count all dynamic allocations
261− inc_ref_count_in_memory(*alloc_copy->alloc_type, alloc_copy->allocation());
261+ inc_ref_count_in_memory(*alloc_copy->alloc_type, alloc_copy->get_allocation());
262262
263263 debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "copy: vm alloc: %#" PRIxPTR " %#" PRIxPTR "\n", &other, alloc_copy);
264264 return alloc_copy;
@@ -289,7 +289,7 @@ vm_alloc_t::~vm_alloc_t() · 24 unmodified lines
289289 finalizer(this);
290290
291291 // Free pointer types
292− destroy_memory(*alloc_type, allocation());
292+ destroy_memory(*alloc_type, get_allocation());
293293 debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "destroy: vm alloc\n");
294294 }
295295
@@ -314,7 +314,7 @@ std::size_t vm_alloc_t::get_ref_count() const · 18 unmodified lines
314314 return _ref_count;
315315 }
316316
317−pointer_t vm_alloc_t::allocation() const
317+pointer_t vm_alloc_t::get_allocation() const
318318 {
319319 // Remove const on the this pointer so the offset can be computed.
320320 auto non_const_this = const_cast<vm_alloc_t *>(this);