http://d.puremagic.com/issues/show_bug.cgi?id=4358



--- Comment #8 from Leandro Lucarella <llu...@gmail.com> 2010-06-22 10:03:22 
PDT ---
(In reply to comment #7)
> std.file.read returns a void[], but it's allocated manually via gc.malloc(),
> and I think the no-pointers thing was done right.

And what is the rationale for not returning ubyte[]?

> The correct solution to this problem would be to apply the patch in bug 3463
> (precise heap scanning), and then probably investigate precise stack scanning.

You can't have full precise scanning in D, because of unions and other
low-level constructs, so the problem of false pointers will be still there even
with that patch (of course the chances of having a false pointer will be much
lower).

> I believe the patch in bug 2927 (no interior pointers attribute) would not 
> roll
> well with Andrei's safety ideology, so let's forget that.

That's stupid, it's not unsafer than NO_SCAN or casting a pointer to int, or
whatever construct you like. That's obviously a construct that not everybody
will use. So let's not forget that (and putting words in somebody else's mouth
is not a good argument either =).

> Note that enhancement 2927 could be simulated by using a wrapper object, that
> behaves like an array, but actually uses C malloc to allocate memory. When the
> wrapper gets collected, its finalizer can free() the memory. Or using 
> reference
> counting, like (I believe) Andrei's TightArray (or what was it named) does.

That's true, is a little more convoluted than having NO_INTERIOR and is not as
easy to use by the compiler itself, but could be another option.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to