GC.sizeOf(array.ptr)

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 30 10:23:21 PDT 2014


On Tuesday, 30 September 2014 at 13:42:14 UTC, Dicebot wrote:
>
> Is such behaviour intended?

Yes.  As far as the GC is concerned, asking for the size of an
interior pointer is asking for the size of a slice of the data,
and as slices are not extendable it will always return 0.  All of
the APPENDABLE stuff takes place outside the GC (except for the
definition of the APPENDABLE BlkAttr, which really should be
defined externally and within the user-reserved range of the
bitfield instead of the GC-reserved range, but I digress...) and
so it has no way of knowing that someone is using the blocks this
way.


More information about the Digitalmars-d mailing list