push_integer() not implemented in class 'FixedPMCArray'

Andrew Whitworth wknight8111 at gmail.com
Wed Sep 9 17:14:24 UTC 2009


On Wed, Sep 9, 2009 at 9:36 AM, Austin
Hastings<Austin_Hastings at yahoo.com> wrote:
> Adding ppsu would make PVM "more complete", but it probably wouldn't change
> the way people are writing PIR - old habits, etc.

The Fixed*Array types allocate a fixed amount of storage. Adding ppsu
ops to it would require keeping track of not only how much storage we
have allocated (some of which is possibly empty), but also keeping
track of where the current "beginning" and "end" of the array are, so
we can add/remove items from both ends. Also, if we start talking
about the edge cases where we try to push on more objects then there
is space, we either need to throw exceptions or start rotating
objects, or whatever. What we'd end up with is some variant on a
circular buffer, which is much more heavy weight then we really need.

However we do it, we're adding a lot of runtime checks and additional
logic to support the kinds of dynamic operations that Resizable*Array
PMCs already implement. We don't need both sets of PMCs to implement
all the same behaviors. If you need ppsu ops, use the Resizable*
variants and the associated performance penalties. If you don't need
the capability, use the Fixed* ones which are less expensive by
design.

--Andrew Whitworth


More information about the parrot-dev mailing list