paavohtl Claude Opus 4.6 (1M context) commited on
Commit
9069718
·
1 Parent(s): 1843fe0

refactor: use wa_alloc::{wa_malloc, wa_free} from openwa-core

Browse files

Remove duplicate wa_malloc/wa_free definitions from replay module,
import from openwa_core::wa_alloc instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

crates/openwa-wormkit/src/replacements/replay.rs CHANGED
@@ -8,6 +8,7 @@ use crate::log_line;
8
  use openwa_core::address::va;
9
  use openwa_core::engine::replay::{self, ReplayError, ReplayStream};
10
  use openwa_core::rebase::rb;
 
11
 
12
  use core::ffi::c_void;
13
  use core::fmt::Write;
@@ -30,12 +31,6 @@ unsafe fn wa_fread(b: *mut c_void, sz: u32, c: u32, f: *mut FILE) -> u32 {
30
  unsafe fn wa_fwrite(b: *const c_void, sz: u32, c: u32, f: *mut FILE) -> u32 {
31
  core::mem::transmute::<_, unsafe extern "cdecl" fn(*const c_void, u32, u32, *mut FILE) -> u32>(rb(0x5D3B76))(b, sz, c, f)
32
  }
33
- unsafe fn wa_malloc(sz: u32) -> *mut u8 {
34
- core::mem::transmute::<_, unsafe extern "cdecl" fn(u32) -> *mut u8>(rb(0x5D0F65))(sz)
35
- }
36
- unsafe fn wa_free(p: *mut u8) {
37
- core::mem::transmute::<_, unsafe extern "cdecl" fn(*mut u8)>(rb(0x5D0D2B))(p);
38
- }
39
  unsafe fn wa_fileno(s: *mut FILE) -> i32 {
40
  core::mem::transmute::<_, unsafe extern "cdecl" fn(*mut FILE) -> i32>(rb(0x5D5155))(s)
41
  }
 
8
  use openwa_core::address::va;
9
  use openwa_core::engine::replay::{self, ReplayError, ReplayStream};
10
  use openwa_core::rebase::rb;
11
+ use openwa_core::wa_alloc::{wa_malloc, wa_free};
12
 
13
  use core::ffi::c_void;
14
  use core::fmt::Write;
 
31
  unsafe fn wa_fwrite(b: *const c_void, sz: u32, c: u32, f: *mut FILE) -> u32 {
32
  core::mem::transmute::<_, unsafe extern "cdecl" fn(*const c_void, u32, u32, *mut FILE) -> u32>(rb(0x5D3B76))(b, sz, c, f)
33
  }
 
 
 
 
 
 
34
  unsafe fn wa_fileno(s: *mut FILE) -> i32 {
35
  core::mem::transmute::<_, unsafe extern "cdecl" fn(*mut FILE) -> i32>(rb(0x5D5155))(s)
36
  }