Giter VIP home page Giter VIP logo

heap-vec's People

Contributors

colonelphantom avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

saethlin

heap-vec's Issues

Add Debug impl

I might start a PR for this soon, but I wanted to create an issue for it. Basically, impl Debug for HeapVec.

Add leak() method to HeapVec

I am currently in a situation where I need to avoid random lookups, and this crate has what I need. However, the actual pointer to the underlying memory is still wrapped behind the HeapVec. In my situation, I am looking at using the underlying heap-allocated memory to create an undirected graph. When there is a reallocaton that changes the underlying pointer to the heap allocation, I need to be able to get that updated pointer (or wrapped handle, HeapVec) and update the other pointers in neighbor nodes to that memory. The API I am looking for would definitely be unsafe. I can use pointer comparisons to see if the realloc moved the HeapVec, but if an API is added that would allow me to, for instance, leak the contents of the HeapVec, that would help a lot in supporting what I am working on. For now, I will write a 0 pointer to the memory of the HeapVec, and that should set the *const T in Unique<T> to 0, which should effectively perform a leak. When I say leak, I mean exactly like https://doc.rust-lang.org/std/vec/struct.Vec.html#method.leak. All that I want is to ensure that drop() is not called on the types stored in the vector when I remove the node from its neighbor in the graph.

I am currently working on this approximate nearest neighbor search crate. The biggest problem I have is that I can't have two random lookups for the neighbors of each node (which are dynamic in number) without impacting performance significantly. I have been looking at how I could store the length and capacity for the vector on the heap alongside the memory for the actual data to avoid those extra random accesses, and I ran into this crate. Thanks for making it and figuring out all the alignment stuff. This is an excellent crate, and I think it deserves more attention. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.