Crates.io | quickjs_android_suitable_sys |
lib.rs | quickjs_android_suitable_sys |
version | 0.20220306.3 |
source | src |
created_at | 2020-08-11 16:31:51.629465 |
updated_at | 2023-08-08 03:23:17.203259 |
description | QuickJS Javascript Engine FFI bindings, suitable for use on Android |
homepage | |
repository | https://github.com/alastaircoote/quickjs-android-suitable-sys |
max_upload_size | |
id | 275398 |
size | 3,219,927 |
FFI Bindings for quickjs. One of many, but I created this one as a fork of libquickjs-sys becuse it wasn't working properly on i686 Android.
The i686 toolchain is used when building for the Android emulator and more or less nothing else these days. It turns out that bindgen isn't aware of compilation target by default and for some reason the code generated for 64bit OSes will crash on i686 Android (and maybe others). This crate rebuilds the bindings whenever the library is built, ensuring platform consistency.
Making this change breaks compatibility with the higher level library that uses libquickjs-sys, so I made a fresh fork. There are a bunch of required functions (e.g. JS_NewBool
) inlined in the header file rather than in the .c
file, so the C compiler doesn't include them. To that end I've created quickjs+extern.c
to expose those functions correctly.
bignum
Enable this to add bigint support to QuickJS
dump_leaks
Dumps out variables still being held in the JS engine whenever it is released. Useful to debugging memory leaks.
Before running cargo publish
please run cargo script scripts/generate-bindings.rs
. There's a better way to do this, I'm sure.