Steve Fink <[EMAIL PROTECTED]> wrote:

> ... Leo's @ANON implementation of
> your scheme works great for me (I have no problem wrapping that around
> my code.) All this does raise the question of garbage collection for
> packfile objects; is there any?

Not yet. We basically have two kinds of dynamically compiled code:

1) loaded modules - persistent code used until end of program
2) evaled "statements" - volatile code, maybe used once only

But the current implementation doesn't know about that difference. The
compiled code is always appended to the list of code segments. There is
no interface yet to manipulate packfile segments.

We finally need a packfile PMC that is the owner of packfile segments.
If that PMC goes out of scope the compiled code structures can be freed.
This packfile PMC would also vastly eliminate the difference between 1)
and 2), the more when there is some interface to be able to append the
newly compiled code to existing code segments, so that you can e.g. dump
the combined code to disc.

But it would still be useful to differentiate between 1) and 2). For 1)
we could do global constant folding (if a constant already exists in the
main contant table just use it, or, if not, append to the main constant
table).

For 2) a distinct constant table is needed.

leo

Reply via email to