Giter VIP home page Giter VIP logo

Comments (3)

myrrlyn avatar myrrlyn commented on June 15, 2024

0.17

Due to potential aliasing of split slices, as_slice -> &[T] is undefined behavior if it includes partial edges.

The function as_total_slice provides access to all elements, including partials, at the cost of marking them all as aliased.

For slices with partial edges, this function allows you to view and modify memory outside the boundaries of the BitSlice that produced them. Keep in mind that using the T::Access type to modify memory backed by a &BitSlice is undefined behavior.

I will update the as_slice documentation to point to as_total_slice as a sibling method.

Trunk/0.18

The changes to the type system in the 0.18 series will allow as_slice to have this behavior, and remove the need for as_total_slice. Any aliasing event will mark all slices that can observe aliased memory so that they always use an alias-safe type. I believe that current trunk still maintains this separation, but it is no longer necessary, and I will remove it if present.

Trunk is unstable and while I strive to keep each published commit to it a buildable snapshot, you should only switch from crates.io to git if you are willing to accept this instability.

I will accelerate my work on getting 0.18 released.

from bitvec.

bkchr avatar bkchr commented on June 15, 2024

Ty! For the moment I will just stick to converting it to a BitVec.

from bitvec.

myrrlyn avatar myrrlyn commented on June 15, 2024

.as_slice now (0.18) returns all elements, as it can detect when it must use aliased vs unaliased types. I am going to mark this as closed; please feel free to reöpen if it turns out that I have in fact not fixed your problem. Thanks for the report!

from bitvec.

Related Issues (20)

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.