Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resizable array questions

10 views
Skip to first unread message

Simon Glover

unread,
Jan 3, 2005, 6:49:37 PM1/3/05
to perl6-i...@perl.org

1) When we resize a Resizable*Array (where * = Integer, Float or String)
by calling set_integer_native, we also set the PMC's active_destroy
flag. However, we don't do this when resizing a ResizablePMCArray
(which also has a different memory allocation strategy). Is this
because we don't strictly need to, or is this just an oversight?

2) Why does the ResizablePMCArray PMC use a different memory allocation
strategy, i.e. what advantage does it have over the strategy used by the
other Resizable arrays?

Simon

Leopold Toetsch

unread,
Jan 4, 2005, 6:34:22 AM1/4/05
to Simon Glover, perl6-i...@perl.org
Simon Glover <sc...@amnh.org> wrote:

> 1) When we resize a Resizable*Array (where * = Integer, Float or String)
> by calling set_integer_native, we also set the PMC's active_destroy
> flag. However, we don't do this when resizing a ResizablePMCArray
> (which also has a different memory allocation strategy). Is this
> because we don't strictly need to, or is this just an oversight?

Just an oversight as well as in FixedPMCArray.

> 2) Why does the ResizablePMCArray PMC use a different memory allocation
> strategy, i.e. what advantage does it have over the strategy used by the
> other Resizable arrays?

Just doubling the allocation size isn't a really good strategy beyond
some big size. So I've implemented a IMHO better strategy in the
PMCArray. Additionally the helper structure Size*Data isn't really
needed.

> Simon

leo

0 new messages