heap-drop 1.0.1

Drop deeply nested structures without stack overflow 🚮
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented2 out of 4 items with examples
  • Size
  • Source code size: 14.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 73.9 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • brooke-ec/heap-drop
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • brooke-ec

heap-drop

Heap drop is a Rust crate designed to solve the problem where deeply nested structures cause a stack overflow when dropped using the normal method generated by the compiler.

The crate exposes a function that iteratively drops the children of the parsed value using a heap-allocated queue, as well as a derive macro for implementing the required plumbing for this functionality!

Pull requests are welcome!

Example

use heap_drop::{HeapDrop, heap_drop};

#[derive(HeapDrop)]
struct Node(Option<Box<Node>>);

let v = Node(Some(Box::new(Node(None /* could be a very deep structure */))));
heap_drop(v); // call before value goes out of scope