Skip to content

Commit

Permalink
Support x64 addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
astonbitecode committed Oct 18, 2023
1 parent f790dea commit d352874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rust/src/api/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ unsafe impl Send for Instance {}
/// On Drop, the InstanceReceiver removes the Box from the heap.
pub struct InstanceReceiver {
pub(crate) rx: Box<Receiver<Instance>>,
tx_address: i64,
tx_address: u64,
}

impl InstanceReceiver {
pub(crate) fn new(rx: Receiver<Instance>, tx_address: i64) -> InstanceReceiver {
pub(crate) fn new(rx: Receiver<Instance>, tx_address: u64) -> InstanceReceiver {
InstanceReceiver {
rx: Box::new(rx),
tx_address,
Expand Down
4 changes: 2 additions & 2 deletions rust/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ impl Jvm {
let raw_ptr = Box::into_raw(tx);
// Find the address of tx
let address_string = format!("{:p}", raw_ptr);
let address = i64::from_str_radix(&address_string[2..], 16).unwrap();
let address = u64::from_str_radix(&address_string[2..], 16).unwrap();

// Second argument: create a jstring to pass as argument for the method_name
let method_name_jstring: jstring =
Expand Down Expand Up @@ -944,7 +944,7 @@ impl Jvm {
let raw_ptr = Box::into_raw(tx);
// Find the address of tx
let address_string = format!("{:p}", raw_ptr);
let address = i64::from_str_radix(&address_string[2..], 16).unwrap();
let address = u64::from_str_radix(&address_string[2..], 16).unwrap();

// Call the method of the instance
let _ = (opt_to_res(cache::get_jni_call_void_method())?)(
Expand Down

0 comments on commit d352874

Please sign in to comment.