-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API for allocating objects whose size is unknown at compiletime #2
Comments
I wonder if this is easily done without DST (dynamic sized types) being properly supported in rustc. But yeah, /me mumbles something about becoming Java |
I'm also thinking of just supporting a raw api like:
or something like that, which allows you to construct a garbage collected pointer from raw data. It would be pretty darned unsafe, but could be useful for some persistent data structures. |
Hm, that could work. But I suspect that we support just enough DST to make |
(It might be as simple as just putting a |
I'll try the |
I think we should focus on soundness first and try to break the GC with tests :) But adding bounds like this is easy enough so go ahead! I had a closer look at the code/design, and while there are some things which could be improved (I'll comment later when I have the time or just fix directly), it looks sound to me. I think. Maybe. 😛 I also had a very illuminating talk with huon and aatch regarding stack scanning. I still think we should avoid it for this project, but perhaps it would be fun to design one of those GCs too once this is finished :) |
Yeah. There are a lot of problems with stack scanning, especially if we decide to let people put garbage collected pointers inside of boxes (which means that the pointer isn't on the stack). I think our mechanisms are the least likely to be unsound, but we should do some more tests. |
Rust is unable to convert |
Right now, the only way to allocate is through the safe
Gc::new()
interface which allocates based on a generic type parameter. It would be nice to also have an unsafeGc::alloc()
interface or similar which allows allocating objects whose size isn't known at compile time.The text was updated successfully, but these errors were encountered: