version(ctfe)

Leandro Lucarella llucax at gmail.com
Mon Oct 19 08:20:22 PDT 2009


Andrei Alexandrescu, el 19 de octubre a las 08:38 me escribiste:
> For relatively large chunks of memory, the GC keeps a control block.
> We could add a member size_t requestedSize that keeps the size that
> was requested with an allocation/reallocation call. The GC can take
> initiative in overallocating memory and expose primitives such as
> requestedSize (how much did the program ask for?) and capacity (how
> much is really allocated?).  With that API, it is possible to
> implement ~= efficiently.

That would mean moving the overhead of arrays to the GC, but that overhead
will be present for *all* objects, arrays or not, so I don't think it will
be a good idea...

Having that information could be used if present though, for example, to
avoid scanning chunks of memory that are not used. That could help
avoiding false positives (if that chunks of memory are not zeroed
already).

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Yo soy Peperino, mártir latino, venid al asado pero traed el vino.
	-- Peperino Pómoro



More information about the Digitalmars-d mailing list