GithubHelp home page GithubHelp logo

sarvex / triomphe-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from manishearth/triomphe

0.0 1.0 0.0 112 KB

Fork of std::sync::Arc with lots of utilities useful for FFI

License: Apache License 2.0

Rust 100.00%

triomphe-rs's Introduction

Triomphe

Fork of Arc. This has the following advantages over std::sync::Arc:

  • triomphe::Arc doesn't support weak references: we save space by excluding the weak reference count, and we don't do extra read-modify-update operations to handle the possibility of weak references.
  • triomphe::UniqueArc allows one to construct a temporarily-mutable Arc which can be converted to a regular triomphe::Arc later
  • triomphe::OffsetArc can be used transparently from C++ code and is compatible with (and can be converted to/from) triomphe::Arc
  • triomphe::ArcBorrow is functionally similar to &triomphe::Arc<T>, however in memory it's simply &T. This makes it more flexible for FFI; the source of the borrow need not be an Arc pinned on the stack (and can instead be a pointer from C++, or an OffsetArc). Additionally, this helps avoid pointer-chasing.
  • triomphe::Arc has can be constructed for dynamically-sized types via from_header_and_iter
  • triomphe::ThinArc provides thin-pointer Arcs to dynamically sized types
  • triomphe::ArcUnion is union of two triomphe:Arcs which fits inside one word of memory

This crate is a version of servo_arc meant for general community use.

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.