Skip to content

Commit ec75763

Browse files
simongdaviesludfjig
authored andcommitted
Make stack pointer size constant and update output/input data pointer offset methods to be public
Signed-off-by: Simon Davies <[email protected]>
1 parent cb0e562 commit ec75763

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hyperlight_host/src/mem/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl SandboxMemoryLayout {
246246
pub(crate) const BASE_ADDRESS: usize = 0x0;
247247

248248
// the offset into a sandbox's input/output buffer where the stack starts
249-
const STACK_POINTER_SIZE_BYTES: u64 = 8;
249+
pub(crate) const STACK_POINTER_SIZE_BYTES: u64 = 8;
250250

251251
/// Create a new `SandboxMemoryLayout` with the given
252252
/// `SandboxConfiguration`, code size and stack/heap size.
@@ -397,7 +397,7 @@ impl SandboxMemoryLayout {
397397

398398
/// Get the offset in guest memory to the output data pointer.
399399
#[instrument(skip_all, parent = Span::current(), level= "Trace")]
400-
fn get_output_data_pointer_offset(&self) -> usize {
400+
pub(super) fn get_output_data_pointer_offset(&self) -> usize {
401401
// This field is immediately after the output data size field,
402402
// which is a `u64`.
403403
self.get_output_data_size_offset() + size_of::<u64>()
@@ -429,7 +429,7 @@ impl SandboxMemoryLayout {
429429

430430
/// Get the offset in guest memory to the input data pointer.
431431
#[instrument(skip_all, parent = Span::current(), level= "Trace")]
432-
fn get_input_data_pointer_offset(&self) -> usize {
432+
pub(super) fn get_input_data_pointer_offset(&self) -> usize {
433433
// The input data pointer is immediately after the input
434434
// data size field in the input data `GuestMemoryRegion` struct which is a `u64`.
435435
self.get_input_data_size_offset() + size_of::<u64>()

0 commit comments

Comments
 (0)