mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-14 18:01:58 +00:00
libghostty: simplify Wasm allocation API
Replace a bunch of type-specific Wasm allocation functions with a generic byte allocator and reusable opaque out-parameters for pointers. This makes it a lot more ergonomic (relatively) to use the Wasm interface and removes a dozen or so exports. This also updates the `ghostty_type_json` `abi` field with a maximum alignment value that host sides can use to keep every allocation aligned properly, easily, without hardcoding numbers. This adds a test to verify this all works as intended and runs in CI.
This commit is contained in:
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -733,6 +733,11 @@ jobs:
|
||||
echo "Verified ${artifact} requires simd128"
|
||||
done
|
||||
|
||||
- name: Test WASM allocator
|
||||
run: |
|
||||
nix develop -c node test/wasm-alloc.mjs ghostty-vt.wasm
|
||||
nix develop -c node test/wasm-alloc.mjs ghostty-vt-small.wasm
|
||||
|
||||
# Compile-only checks for the -Dvt-features flags so that future changes
|
||||
# don't regress any feature combination.
|
||||
build-libghostty-vt-features:
|
||||
|
||||
Reference in New Issue
Block a user