allocated-btree

Crates.ioallocated-btree
lib.rsallocated-btree
version0.1.3
created_at2025-12-28 19:05:35.177932+00
updated_at2026-01-16 07:52:01.187985+00
descriptionB-Tree data structures with explicit allocator control using the allocated pattern
homepagehttps://github.com/alexchamberlain/allocated-btree
repositoryhttps://github.com/alexchamberlain/allocated-btree
max_upload_size
id2009274
size472,242
Alex Chamberlain (alexchamberlain)

documentation

https://docs.rs/allocated-btree

README

allocated-btree

crates.io Released API docs

An implementation of a B-Tree using the allocated pattern.

This crate provides 2 main interfaces:

  • allocated_btree::AllocatedNaiveBTreeMap - a naive BTree that uses a single node shape
  • allocated_btree::AllocatedCompressedBTreeMap - a compressed BTree that uses an optimised leaf node

The compressed data structure uses around 50% of the memory of the naive data structure.

Most of this code was written before code generating AI was widespread. However, Claude Code has been used to fix a couple of bugs, fix typos and improve the documentation since then.

Motivation

The main motivation for this crate is to serve as an example of how to use the allocated crate, especially how to compare 2 data structures using an allocator.

License

Copyright 2024 Alex Chamberlain

This project is licensed under either of

at your option.

Commit count: 0

cargo fmt