warlock

Crates.iowarlock
lib.rswarlock
version0.0.4
sourcesrc
created_at2021-04-26 14:52:27.247651
updated_at2021-04-26 20:03:59.876115
descriptionArena allocation optimized collections
homepage
repository
max_upload_size
id389727
size14,543
(hermit-official)

documentation

README

Table of Contents

  1. Warlock
    1. More

    2. Goals

    3. Non-goals

    4. Why not to use this crate

    5. About allocators

Warlock

A collection of data structures optimized for use alongside an arena allocator.

More

Warlock provides some collections typically provided by std which are optimized for use alongside an arena allocator. That is, these collections DO NOT free their own memory. The memory they allocate is expected to be cleaned up by the allocator itself. However, when the collections contain items that `impl Drop`, the collections will drop any items they contain properly.

These collections also differ slightly from the standard collections in that they assume that memory allocations can fail, and will return `Result`s for any operation that allocates memory.

Warlock also provides a very, very, very simple bump allocator, which may be used alongside these data structures.

Goals

  • As close to std as possible

  • Compile on Rust stable (see 1.5 for more information)

Non-goals

  • Be a 100% drop-in replacement for std containers

Why not to use this crate

  • You want collections that behave correctly w/r/t memory allocation under any circumstance.

  • You want a 100% stable crate. This crate is under heavy development

About allocators

As of this writing, there is currently an ongoing effort to add a standard Allocator trait/concept to std. It is partially complete, however, I expect that it will be quite a while before it lands in stable. In the meantime, this crate provides an Allocator trait which is designed to be as close as possible to the proposed standard. Once the standard Allocator trait is merged, this will be dropped.

In the future, this crate will provide an optional feature which will add a blanket implementation of the std Allocator trait for warlock::Allocator.

Commit count: 0

cargo fmt