Nattfodd wrote:
Leopold Toetsch wrote:

I believe that if we want variable-sized body, we need at least one next
(or pmc_size) pointer in the header.

Not necessarily. We can have:

- some type bits in the gmc_header for fixed-sized and commonly used objects, so that GMC knows the size
- alternatevily use an object size field in the vtable
- force variable sized objects to have a word-size at a known object location e.g. just the first word (like PMC_int_val for current arrays)

Therefore we can always calculate the object size and walk the pmc_body memory.

Do you see any other solution that could avoid prev and next ?

We just need a next pointer for managing holes in the pmc_body memory space. That's basically the same as in a memory allocator.

Regards,
Alexandre

leo

Reply via email to