> This patch is the real fix for strings with the BUFFER_external_FLAG.
> It requires the previous dod.c and resources.c patches to be applied.
>
> Strings marked with the BUFFER_external_FLAG point to the external
> memory rather than making a copy for themselves. Side effects of this
> are (1) less memory usage, (2) external updates to the string are
> reflected in the Parrot STRING (except for length changes!), and (3)
> these strings are skipped over when memory is getting moved around
> during a compaction.

Fixing BUFFER_external_FLAG is probably a good thing, and I'm up for
applying them after 008 goes out the door. However, BUFFER_external_FLAG
and BUFFER_selfpoolptr_FLAG almost seem to have complementary purposes
now. (The latter was something that I introduced along with the
current COW version.)

selfpoolptr indicates that the header references memory in the local pool.
This allows a non-constant-header string to point cowingly towards a
constant buffer in the constant pool. The selfpoolptr flag would be false,
and it would avoid collecting/copying/destroying the data. This is rather
similar in nature to external's behavior, and I imagine we could either:
a) make them act identically, like this patch does
b) just have people who want external data to unset selfpoolptr.

Thoughts?
Mike Lambert


Reply via email to