3 releases

0.1.2 Aug 28, 2022
0.1.1 Aug 28, 2022
0.1.0 Aug 27, 2022

#594 in Memory management

Download history 95/week @ 2024-02-15 40/week @ 2024-02-22 20/week @ 2024-02-29

148 downloads per month

AGPL-3.0-only

25KB
371 lines

outsource-heap

This crate provides a mechanism for setting the global allocator for a particular task.


lib.rs:

outsource-heap

This library provides tools for outsourcing your heap allocations to various places, including:

  • A local file
  • A network drive
  • Anything which implements the Store trait, like a Vec<MaybeUninit<u8>>

Generally speaking, using this library is a bad idea. Once the Rust standard library has a stable allocator API this library will (hopefully) be made wholly obsolete.

In the meantime, let's do some cursed nonsense.

Getting Started

This crate provides a global allocator, which is used to intercept all allocations in your program so it can decide where to direct them. Therefore, the following must be placed somewhere in your project:

#[global_allocator]
static ALLOC: outsource_heap::Global = outsource_heap::Global::system();

Dependencies

~155KB