Skip to content

Commit

Permalink
rename malloc to allocate to fix conflict in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Daksh14 committed Sep 24, 2023
1 parent 5c2938d commit 95747f1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified assets/dusk_wallet_core.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{key, tx, types, utils, MAX_KEY, MAX_LEN};

/// Allocates a buffer of `len` bytes on the WASM memory.
#[no_mangle]
pub fn malloc(len: i32) -> i32 {
pub fn allocate(len: i32) -> i32 {
let bytes = vec![0u8; len as usize];
let ptr = bytes.as_ptr();
mem::forget(bytes);
Expand Down
2 changes: 1 addition & 1 deletion tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl Wallet {
let ptr = self
.instance
.exports
.get_function("malloc")
.get_function("allocate")
.unwrap()
.call(&mut self.store, &[len.clone()])
.unwrap()[0]
Expand Down

0 comments on commit 95747f1

Please sign in to comment.