On Jan 6, 2004, at 3:41 PM, Luke Palmer wrote:

Leopold Toetsch writes:

Good. Pass it over to me :) COW copy of stacks and of other buffer-based
items is still broken. These need distinct headers so that they work
like COWed strings.

Alright, I've got a pretty big incomplete patch here (see, when one has a deadline on a compiler written with the assumption of working continuations, one can be pretty determined :-).

It makes each chunk into a subclass of Buffer like so:

    struct RegisterChunkBuf {
        size_t used;
        PObj* next;
    };

To do that properly, I think you need a pobj_t as the first struct member, like string has:


struct parrot_string_t {
    pobj_t obj;
    UINTVAL bufused;
    void *strstart;
    UINTVAL strlen;
    const ENCODING *encoding;
    const CHARTYPE *type;
    INTVAL language;
};

so maybe something like:

struct RegisterChunkBuf {
    pobj_t obj;
    UINTVAL bufused;
    RegisterChunkBuf* next;
};

But also take a look at list.h and see if it's already doing what you want to do; you may be able to do it directly.

And then, for example:

    struct PRegChunkBuf {
        struct RegisterChunkBuf buf;
        struct PRegFrame PRegFrame[FRAMES_PER_CHUNK];
    };

I want these things to be garbage collected, but DOD doesn't trace the
buffer.  I can't seem to find a way to mark the frames without making
the chunks into PMCs (yuck).   Is there a way to do this?

I think you'll need to add something to the root set tracing code (probably trace_active_buffers() in src/dod.c). I'm not sure what all of you stuff hangs off of, though.


Just some thoughts--I'm a little fuzzy on where these items are rooted.

JEff



Reply via email to