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

[perl #30245] [PATCH] Resizable*Array pmcs

8 views
Skip to first unread message

Matt Fowles

unread,
Jun 13, 2004, 3:42:36 AM6/13/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Fowles
# Please include the string: [perl #30245]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30245 >


All~

This patch adds Resizable*Array pmcs as the counterparts to Fixed*Array
pmcs. It does so by inheriting from them, so the Fixed ones are changed
too.

This includes the patch from Nicholas Clark [perl #30241]
t/pmc/fixedfloatarray.t SEGV on x86 Linux.

Tests are included.

One important note. This is a really simple implementation. One might
want to do something like size doubling or something smart, but this
doesn't do that.

Matt

resizable.patch

Dan Sugalski

unread,
Jun 14, 2004, 10:02:52 AM6/14/04
to perl6-i...@perl.org, bugs-bi...@rt.perl.org, Matt Fowles
At 12:42 AM -0700 6/13/04, Matt Fowles (via RT) wrote:
>This patch adds Resizable*Array pmcs as the counterparts to Fixed*Array
>pmcs. It does so by inheriting from them, so the Fixed ones are changed
>too.

Applied, thanks.
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Leopold Toetsch

unread,
Jun 14, 2004, 11:50:46 AM6/14/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski <d...@sidhe.org> wrote:
> At 12:42 AM -0700 6/13/04, Matt Fowles (via RT) wrote:
>>This patch adds Resizable*Array pmcs as the counterparts to Fixed*Array
>>pmcs. It does so by inheriting from them, so the Fixed ones are changed
>>too.

> Applied, thanks.

- duplicates existing PMCs functionality:
IntList <-> ResizableIntegerArray
FloatvalArray <-> ResizableFloatArray
PerlArray <-> ResizablePMCArray
Array <-> FixedMCArray

- incomplete: push/pop/shift/unshift/splice/freeze/thaw

- It's broken (realloced mem isn't cleared always)

= It's 2 times slower for filling arrays with this loop:

i = 0
lp:
ar[i] = 1
inc i
if i < n goto lp

- clone is different (shallow vs deep) - whatever is right

leo

Dan Sugalski

unread,
Jun 14, 2004, 12:12:10 PM6/14/04
to l...@toetsch.at, perl6-i...@perl.org
At 5:50 PM +0200 6/14/04, Leopold Toetsch wrote:
>Dan Sugalski <d...@sidhe.org> wrote:
>> At 12:42 AM -0700 6/13/04, Matt Fowles (via RT) wrote:
>>>This patch adds Resizable*Array pmcs as the counterparts to Fixed*Array
>>>pmcs. It does so by inheriting from them, so the Fixed ones are changed
>>>too.
>
>> Applied, thanks.
>
>- duplicates existing PMCs functionality:
> IntList <-> ResizableIntegerArray
> FloatvalArray <-> ResizableFloatArray
> PerlArray <-> ResizablePMCArray
> Array <-> FixedMCArray

Yup. (Well, except for the PerlArray part) Part of this exercise is
to standardize things and toss the things we no longer need.

>- incomplete: push/pop/shift/unshift/splice/freeze/thaw

Then we need to start a todo list.

>- It's broken (realloced mem isn't cleared always)

So fix it, or file a bug report for someone else to fix.

>= It's 2 times slower for filling arrays with this loop:
>
> i = 0
>lp:
> ar[i] = 1
> inc i
> if i < n goto lp

Well, yeah, it's unoptimized. That can be fixed.

>- clone is different (shallow vs deep) - whatever is right

Which needs standardization.

0 new messages