From b6db26d3414f9a8e193ac861d860819b1fc3cb99 Mon Sep 17 00:00:00 2001 From: Frank Emrich Date: Tue, 7 Nov 2023 12:10:41 +0000 Subject: [PATCH] actually remove commented-out code --- crates/runtime/src/continuation.rs | 56 ------------------------------ 1 file changed, 56 deletions(-) diff --git a/crates/runtime/src/continuation.rs b/crates/runtime/src/continuation.rs index 29dbb6c1c739..902ddf3c77ae 100644 --- a/crates/runtime/src/continuation.rs +++ b/crates/runtime/src/continuation.rs @@ -88,62 +88,6 @@ pub fn drop_cont_obj(contobj: *mut ContinuationObject) { unsafe { Vec::from_raw_parts(payloads.data, payloads.length, payloads.capacity) }; } -// /// TODO -// pub fn allocate_payload_buffer(instance: &mut Instance, element_count: usize) -> *mut u128 { -// // In the current design, we allocate a `Vec` and store a pointer to -// // it in the `VMContext` payloads pointer slot. We then return the pointer -// // to the `Vec`'s data, not to the `Vec` itself. -// // This is mostly for debugging purposes, since the `Vec` stores its size. -// // Alternatively, we may allocate the buffer ourselves here and store the -// // pointer directly in the `VMContext`. This would avoid one level of -// // pointer indirection. - -// let payload_ptr = -// unsafe { instance.get_typed_continuations_payloads_ptr_mut() as *mut *mut Vec }; - -// // FIXME(frank-emrich) This doesn't work, yet, because we don't zero-initialize the -// // payload pointer field in the VMContext, meaning that it may initially contain garbage. -// // Ensure that there isn't an active payload buffer. If there was, we didn't clean up propertly -// // assert!(unsafe { (*payload_ptr).is_null() }); - -// let mut vec = Box::new(Vec::::with_capacity(element_count)); - -// let vec_data = (*vec).as_mut_ptr(); -// unsafe { -// *payload_ptr = Box::into_raw(vec); -// } -// return vec_data; -// } - -// /// TODO -// pub fn deallocate_payload_buffer(instance: &mut Instance, element_count: usize) { -// let payload_ptr = -// unsafe { instance.get_typed_continuations_payloads_ptr_mut() as *mut *mut Vec }; - -// let vec = unsafe { Box::from_raw(*payload_ptr) }; - -// // If these don't match something went wrong. -// assert_eq!(vec.capacity(), element_count); - -// unsafe { *payload_ptr = ptr::null_mut() }; - -// // payload buffer destroyed when `vec` goes out of scope -// } - -// /// TODO -// pub fn get_payload_buffer(instance: &mut Instance, element_count: usize) -> *mut u128 { -// let payload_ptr = -// unsafe { instance.get_typed_continuations_payloads_ptr_mut() as *mut *mut Vec }; - -// let vec = unsafe { (*payload_ptr).as_mut().unwrap() }; - -// // If these don't match something went wrong. -// assert_eq!(vec.capacity(), element_count); - -// let vec_data = vec.as_mut_ptr(); -// return vec_data; -// } - /// TODO #[inline(always)] pub fn cont_new(