Skip to content

Commit 73c82a6

Browse files
authored
[SOL] Revert "Update syscalls num (#97)" (#100)
* Revert "[SOL] Update syscalls num (#97)" This reverts commit 0ee1d04. * Re-add comment
1 parent 750aa39 commit 73c82a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

library/std/src/sys/pal/sbf/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ extern "C" {
4141
#[cfg(target_feature = "static-syscalls")]
4242
fn sol_alloc_free_(size: u64, ptr: u64) -> *mut u8 {
4343
let syscall: extern "C" fn(u64, u64) -> *mut u8 =
44-
unsafe { core::mem::transmute(11usize) }; // 11 is the code for "sol_alloc_free_"
44+
unsafe { core::mem::transmute(2213547663u64) }; // murmur32 hash of "sol_alloc_free_"
4545
syscall(size, ptr)
4646
}

library/std/src/sys/pal/sbf/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ extern "C" {
4747

4848
#[cfg(target_feature = "static-syscalls")]
4949
unsafe extern "C" fn abort() -> ! {
50-
let syscall: extern "C" fn() -> ! = core::mem::transmute(1usize); // 1 is the code for "abort"
50+
let syscall: extern "C" fn() -> ! = core::mem::transmute(3069975057u64); // murmur32 hash of "abort"
5151
syscall()
5252
}
5353

5454
#[cfg(target_feature = "static-syscalls")]
5555
unsafe extern "C" fn sol_log_(message: *const u8, length: u64) {
56-
let syscall: extern "C" fn(*const u8, u64) = core::mem::transmute(7usize); // 7 is the code for "sol_log_"
56+
let syscall: extern "C" fn(*const u8, u64) = core::mem::transmute(544561597u64); // murmur32 hash of "sol_log_"
5757
syscall(message, length)
5858
}
5959

0 commit comments

Comments
 (0)