Comments (6)
I don't think it's safe to trace through the RefCell if it's already borrowed. A Drop implementation could mutate it during cycle collection which will break tracing.
In rust-gc GcCell roots the value in borrow_mut():
https://github.com/Manishearth/rust-gc/blob/e362a0687260534305b2749f986da3f0df1ec356/gc/src/lib.rs#L446
and won't trace through GcCell if it's borrowed:
https://github.com/Manishearth/rust-gc/blob/e362a0687260534305b2749f986da3f0df1ec356/gc/src/lib.rs#L464
from bacon-rajan-cc.
This crate never got fully usable.
At minimum, it needs to have its own fork of RefCell that it can see inside of regardless of borrow status so that it can trace the thing's edges. There are probably a lot more issues than just that, but that's what I remember.
Happy to give collaboratorship / co-ownership if you want to finish this!
from bacon-rajan-cc.
Yeah, I'm some what interested. I got it building here: https://github.com/jrmuizel/bacon-rajan-cc/tree/nightly. I'll try to get it split up into more reviewable chunks and post PRs.
from bacon-rajan-cc.
Can you elaborate a bit more on the RefCell issue?
from bacon-rajan-cc.
If cycle collection kicks in while a refcell is borrowed, it may need to trace through the refcell, but that will assert since it is already borrowed. Need a version that allows tracing regardless whether it is borrowed.
from bacon-rajan-cc.
This is done now.
from bacon-rajan-cc.
Related Issues (19)
- CcBox (and likely Cc) need 'static (or !Drop) bound for soundness HOT 2
- data is deallocated while holding a mutable reference
- Add atomic support. HOT 1
- attempt to subtract with overflow HOT 2
- Crash on keeping weak references after collecting a cycle (minor bug)
- Free too soon in mark_roots() (suspected bug) HOT 3
- How to use Cc<T> with multithreading? HOT 4
- Add function to insure all memory is freed at the at the end of each test. HOT 1
- Miri flag passing changed HOT 1
- "Invalid access during cycle collection" - collect_cycles() leaves live nodes with zero refs HOT 4
- Weak<> doesn't work properly HOT 1
- miri shows undefined behaviour when run with -Zmiri-tag-raw-pointers HOT 1
- Incorrect Docs for Trace
- Use-after-free? HOT 4
- Clarify Trace trait usage HOT 1
- Drop is unsound
- How to user #[derive(Trace)?] HOT 3
- Invalid Memory Access HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bacon-rajan-cc.