Skip to content

Commit

Permalink
Fix conditional attributes in exported allocator name. (#299)
Browse files Browse the repository at this point in the history
`#[export_name]` already takes precedence over `#[no_mangle]`,
so this is a no-op, but it silences the warning.

Found with nightly.

Signed-off-by: Piotr Sikora <[email protected]>
  • Loading branch information
PiotrSikora authored Jan 15, 2025
1 parent e71c1af commit c502d38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::mem::MaybeUninit;
all(target_arch = "wasm32", target_os = "unknown"),
export_name = "malloc"
)]
#[no_mangle]
#[cfg_attr(not(all(target_arch = "wasm32", target_os = "unknown")), no_mangle)]
pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 {
let mut vec: Vec<MaybeUninit<u8>> = Vec::with_capacity(size);
unsafe {
Expand Down

0 comments on commit c502d38

Please sign in to comment.