Repository navigation
Version 0.1.4
bstack 0.1.4
This release introduces new methods for efficient payload manipulation and space management, enabling zero-cost reservations, in-place zeroing, and fast truncation.
What's New
extendmethod (Rust) /bstack_extend(C): Appendnzero bytes to the tail and durable-sync. Returns the starting logical offset.n = 0is a no-op. Useful for reserving space in the payload without a caller-supplied buffer.zeromethod (Rust,setfeature) /bstack_zero(C,BSTACK_FEATURE_SET): Overwritenbytes with zeros in place at a logical offset and durable-sync, without changing the file size.n = 0is a no-op; errors ifoffset + nexceeds the payload size.discardmethod (Rust) /bstack_discard(C): Remove the lastnbytes from the tail and durable-sync, without reading or returning the removed bytes. Equivalent topop/bstack_popbut skips the buffer read, avoiding any allocation or copy.n = 0is a no-op; exceeding the payload size returns an error.
Platforms
This release ships pre-built static libraries for eight platforms:
| Archive | Architecture | OS |
|---|---|---|
x86_64-apple-darwin.tar.gz |
x86-64 | macOS |
aarch64-apple-darwin.tar.gz |
Apple Silicon (arm64) | macOS |
x86_64-unknown-linux-gnu.tar.gz |
x86-64 | Linux (glibc) |
aarch64-unknown-linux-gnu.tar.gz |
arm64 | Linux (glibc) |
x86_64-unknown-linux-musl.tar.gz |
x86-64 | Linux (musl) |
aarch64-unknown-linux-musl.tar.gz |
arm64 | Linux (musl) |
x86_64-pc-windows-gnu.zip |
x86-64 | Windows |
aarch64-pc-windows-gnullvm.zip |
arm64 | Windows |
Feature variants
Both Rust and C implementations ship in two variants:
| Variant | Rust | C |
|---|---|---|
| Default | libbstack.rlib |
libbstack.a |
With set |
libbstack-set.rlib |
libbstack-set.a |
The set feature enables in-place overwrite of existing payload bytes without changing the file size.
Rust — add to Cargo.toml:
[dependencies]
bstack = { version = "0.1.4", features = ["set"] } # or omit features for the defaultC — link against the appropriate library and define the macro when compiling code that calls bstack_set:
cc -DBSTACK_FEATURE_SET -I path/to/c myapp.c -L path/to/c -lbstack-set