Skip to content

Simple memory allocator for small copyable objects

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

DaseinPhaos/aren_alloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aren_alloc

travis Crates.io

A thread-local memory allocator backed up by the concept of object pools, used to address the memory allocation needs of arendur.

This crate is useful when

  • you want to frequently create and destroy some objects
  • these objects are copyable small ones, with size under 256 bytes
  • you want the underlying memory to be reused
  • you want a unified interface for the pool, rather than a typed one

Usage

use aren_alloc::Allocator;
#[derive(Copy, Clone)]
struct Point(u32, u32);
let allocator = Allocator::new();
let p = allocator.alloc(Point(1, 2));
assert_eq!(p.0, 1);
assert_eq!(p.1, 2);

As CoerceUnsized is supported for Pointer, compiling would require a nightly version.

License

This project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

About

Simple memory allocator for small copyable objects

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages