On 2015-09-23 5:49 PM, Terrence Cole wrote:
In Mozilla's C++ dialect, these two are roughly equivalent because fallible
init goes though a manual |bool init(...args...)| function after rooting
(and the tracer needs to deal with partial init). In the rust world that I
envision, you'd be able to fallibly construct something like (please excuse
me if my rust ideoms are old /and/ shaky):
let foo: Rooted<Foo> = match Foo::new(..args..) {
Err(err) => handleErr!(...),
Ok(foo) => Rooted<Foo>(foo)
};
Does this help at all or have I totally misunderstood the problem you are
facing? Please ping me on IRC and we can discuss this! The GC team is now
actively churning towards a simpler (and ideally C-wrappable) API and I'd
like to make sure we're all on the same page.
This looks like a plausible solution to my problem. Nevertheless, it
looks like if Foo::new returns a value which contains GC pointers then
it's a potential hazard, right?
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo