Dan Sugalski <[EMAIL PROTECTED]> writes:
>Okay, I've been pondering complex data structures, garbage collection, and
>cache coherency for the past few days. (Between this, Unicode, the regex
>engine, and backwards compatibility, I'll be easy to spot at TPC 5.0. Just
>look for the tall guy wearing the wraparound canvas sweater...) Because of
>that, I'm wondering whether it'd be in our best interests to have some sort
>of split data structure for PMCs.
>
>We're going to have the advantage of *knowing* that all our PMCs will be
>allocated out of arenas, which means we can safely partition the arenas
>into pieces that correspond to pieces of the PMC. For an example, it would
>mean we could do:
>
> struct arena {
> struct base_PMC[4096];
> long PMC_GC_data[4096];
> }
Neat. (probe for page size?)
>
>and know that arena.PMC_GC_data[12] corresponded to arena.base_PMC[12].
>
>This makes sense for pieces of a structure that are reasonably little used,
>like the GC info. (Which is used only by the garbage collector and should,
>I'd hope, be accessed significantly less than the rest of the PMC data)
>
>This works out well for the garbage collector, since it will be dealing
>with arenas as arrays of PMCs. What I'm not sure of is whether this would
>benefit us with other pieces of a PMC.
Depends what they are. The scheme effectively makes the part "mandatory"
as we will have allocated space whether used or not.
So it depends if access pattern means that the part is seldom used,
or used in a different way.
As you say works well for GC of PMCs - and also possibly for compile-time
or debug parts of ops but is not obviously useful otherwise.
>I'm thinking that passing around an
>arena address and offset and going in as a set of arrays is probably
>suboptimal in general,
You don't, you pass PMC * and have offset embedded within the PMC
then arena base is (pmc - pmc->offset) iff you need it.
>but I'm curious as to whether anyone has any hard
>experience with this sort of thing before I delve in any deeper.
>
> Dan
>
>--------------------------------------"it's like this"-------------------
>Dan Sugalski even samurai
>[EMAIL PROTECTED] have teddy bears and even
> teddy bears get drunk
--
Nick Ing-Simmons