core::rt: Add the local heap to newsched tasks
Reusing the existing boxed_region implementation from the runtime
This commit is contained in:
@@ -851,6 +851,41 @@ rust_initialize_global_state() {
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" CDECL memory_region*
|
||||
rust_new_memory_region(uintptr_t synchronized,
|
||||
uintptr_t detailed_leaks,
|
||||
uintptr_t poison_on_free) {
|
||||
return new memory_region((bool)synchronized,
|
||||
(bool)detailed_leaks,
|
||||
(bool)poison_on_free);
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
rust_delete_memory_region(memory_region *region) {
|
||||
delete region;
|
||||
}
|
||||
|
||||
extern "C" CDECL boxed_region*
|
||||
rust_new_boxed_region(memory_region *region,
|
||||
uintptr_t poison_on_free) {
|
||||
return new boxed_region(region, poison_on_free);
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
rust_delete_boxed_region(boxed_region *region) {
|
||||
delete region;
|
||||
}
|
||||
|
||||
extern "C" CDECL rust_opaque_box*
|
||||
rust_boxed_region_malloc(boxed_region *region, type_desc *td, size_t size) {
|
||||
return region->malloc(td, size);
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
rust_boxed_region_free(boxed_region *region, rust_opaque_box *box) {
|
||||
region->free(box);
|
||||
}
|
||||
|
||||
//
|
||||
// Local Variables:
|
||||
// mode: C++
|
||||
|
||||
Reference in New Issue
Block a user