On Thursday, 17 April 2014 at 18:17:59 UTC, Kagamin wrote:
State* pointer in sokoban example is a perfect 1 indirection.

It is not related to actual "dynamic struct" thing, which is why I have highlighted the line to look at. Minimal example is this:

struct Dynamic
{
    size_t length;
    int[0] payload;
}

void main()
{
    const length = 42;
    Dynamic* entity = alloca(Dynamic.sizeof + int.sizeof*length);
    entity.length = length;

    // pointer to same stack space so not really an indirection
    entity.payload[5] = 43;
}

Reply via email to