Memory allocation in D
Sean Kelly
sean at f4.ca
Sat Dec 1 07:54:21 PST 2007
Oskar Linde wrote:
>
> The problems that would arise if the GC didn't allocate that extra byte are
>
> * appending to a [$..$] slice would in some cases be confused by the gc
> as appending to a [0..0] slice of the following allocated array, and
> thereby corrupting that memory.
>
> * all pointers past the end prevents the consecutive memory area to be
> reclaimed by the GC.
Okay that makes sense. The Boehm GC tied the +1 byte to whether
internal pointers were allowed so I was wondering if it was something
along these lines. Thanks.
Sean
More information about the Digitalmars-d
mailing list