Skip to content

Commit cb83d6e

Browse files
committed
[guest,guest_bin] moved memory mod to guest_bin_library
This module defines C-wrappers for our global allocator, specific to the needs of our C-API and custom guests, so it makes sense to move it. Signed-off-by: danbugs <[email protected]>
1 parent 42a048d commit cb83d6e

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/hyperlight_guest/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ limitations under the License.
2020
extern crate alloc;
2121

2222
// Modules
23-
pub mod exit;
2423
pub mod error;
25-
// TODO(danbugs): Move this to hyperlight_guest_bin
26-
pub mod memory;
24+
pub mod exit;
2725

2826
pub mod guest_handle {
2927
pub mod handle;

src/hyperlight_guest_bin/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub mod guest_function {
5151

5252
pub mod guest_logger;
5353
pub mod host_comm;
54+
pub mod memory;
5455

5556
// === Globals ===
5657
#[global_allocator]

src/hyperlight_guest/src/memory.rs renamed to src/hyperlight_guest_bin/src/memory.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ use core::mem::{align_of, size_of};
2020
use core::ptr;
2121

2222
use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;
23-
24-
use crate::exit::abort_with_code;
25-
26-
extern crate alloc;
23+
use hyperlight_guest::exit::abort_with_code;
2724

2825
/*
2926
C-wrappers for Rust's registered global allocator.

src/tests/rust_guests/simpleguest/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ use hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result;
4747
use hyperlight_common::mem::PAGE_SIZE;
4848
use hyperlight_guest::error::{HyperlightGuestError, Result};
4949
use hyperlight_guest::exit::{abort_with_code, abort_with_code_and_message};
50-
use hyperlight_guest::memory::malloc;
5150
use hyperlight_guest_bin::guest_function::definition::GuestFunctionDefinition;
5251
use hyperlight_guest_bin::guest_function::register::register_function;
5352
use hyperlight_guest_bin::host_comm::{call_host_function, call_host_function_without_returning};
53+
use hyperlight_guest_bin::memory::malloc;
5454
use hyperlight_guest_bin::{guest_logger, MIN_STACK_ADDRESS};
5555
use log::{error, LevelFilter};
5656

0 commit comments

Comments
 (0)