Skip to content

Commit 2bfdedd

Browse files
committed
fix: Use uint64_t for RustBuffer fields to fix 32-bit ARM ABI
RustBuffer must use uint64_t (not size_t) for capacity/len fields to match UniFFI's C ABI on all platforms. Using size_t causes stack corruption on 32-bit ARM (armeabi-v7a) where size_t is 4 bytes but Rust expects 8-byte u64. Fixes crash in constructor marshalling on Amazon Fire TV. References: - https://mozilla.github.io/uniffi-rs/0.27/internals/api/uniffi/struct.RustBuffer.html - mozilla/uniffi-rs#2681
1 parent 0360155 commit 2bfdedd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/includes/RustBuffer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <jsi/jsi.h>
1212

1313
struct RustBuffer {
14-
size_t capacity;
15-
size_t len;
14+
uint64_t capacity;
15+
uint64_t len;
1616
uint8_t *data;
1717
};

0 commit comments

Comments
 (0)