silly-alloc

Crates.iosilly-alloc
lib.rssilly-alloc
version0.1.0
sourcesrc
created_at2023-04-03 13:20:27.653568
updated_at2023-04-03 13:20:27.653568
descriptionA collection of very basic allocators.
homepage
repositoryhttps://github.com/surma/silly-alloc
max_upload_size
id829080
size34,158
Surma (surma)

documentation

README

silly-alloc

silly_alloc is a collection of very basic allocators that are fast and small. Written with WebAssembly in mind.

Features

  • Bump allocators — Fast and small allocators that cannot free memory.
  • Bucket allocators — Alloctors that excel at frequent allocations and deallocations of a similar size.
  • Works with #![no_std]
  • Support for and tests on wasm32-unknown-unknown and wasm32-wasi.

Warning

This crate is young and experimental. I have tried my best to ensure correct functionality through testing, but it’s very likely that there are bugs. It’s even more likely that features are missing that should be there. Please feel free to open issues or even PRs!

Examples

Running the tests

To run the unit and integration tests:

$ cargo test --target=wasm32-wasi

To run the doc tests, Nightly Rust is required (as cross-compiling doc tests is still experimental) and a special environment variable needs to be set so that the macro crate generates the correct absolute paths for the bucket allocator types.

$ SILLY_ALLOC_DOC_TESTS=1 cargo +nightly test --doc --target wasm32-wasi -Zdoctest-xcompile

License Apache 2.

License: Apache-2.0

Commit count: 45

cargo fmt