develooper Front page | perl.perl6.internals | Postings from September 2005

Re: #34394: [TODO] implement the splice vtable in *PMCArrays

Thread Previous | Thread Next
From:
Jonathan Worthington
Date:
September 19, 2005 09:18
Subject:
Re: #34394: [TODO] implement the splice vtable in *PMCArrays
Message ID:
045301c5bd36$0014e460$0d00000a@jwcsjw
"Nicholas Dronen" <ndronen@technolalia.com> wrote:
> On Sun, Sep 18, 2005 at 11:48:08PM +0100, Jonathan Worthington wrote:
> [ snip ]
>
>> I guess if I could offer any advice, it'd be don't be afraid of asking
>> questions and also expect to have to look at the source to figure some
>> stuff out, because the docs aren't always as great or up to date as you
>> might hope.  Noting where the docs seem wrong/missing/unclear, or if you
>> can and have the time sending in a patch to correct them, would be a big
>> help.
>
> Taking your advice to heart, I'll dive in with an initial question about
> this particular bug.  :-)
>
> I don't know which particular files "*PMCArrays" refers to in #34394.
> I assume that at least some of the C source files in classes/ that
> use Parrot_default_splice instead of their own splice instead of
> Parrot_*PMCArray_splice are the ones that need to be changed.
>
>    $ grep -l Parrot_default_splice *.c | grep array
>    fixedbooleanarray.c
>    fixedfloatarray.c
>    fixedintegerarray.c
>    fixedpmcarray.c
>    fixedstringarray.c
>    floatvalarray.c
>    resizablebooleanarray.c
>    resizablefloatarray.c
>    resizableintegerarray.c
>    resizablepmcarray.c
>    resizablestringarray.c
>    sarray.c
>    stringarray.c
>
> I'll start with fixedpmcarray.c, but #34394 also mentions boolean arrays.
> Any others?
>
The C files are not the things you want to be modifying, but rather the .pmc 
files in the classes directory.  The .c files are generated from the .pmc 
files.  So when you modify a .pmc file, then do a "make", a new .c file is 
generated and then compiled, etc.

The ticket says:-

"The splice opcode has the functionality of the perl5 function, so that
should be rather straight to implement. See also classes/array.pmc:splice.

FixedPMCArray can have a splice too, if the array limit isn't hit."

So I guess this means implement splice in ResizablePMCArray.pmc and 
FixedPMCArray.pmc first.  Then later other arrays can be done, but I'm 
guessing again from the ticket that they used a different allocation scheme 
and that needs changing too.  There's quite a bit to this task I think - so 
I suggest have a go at the *pmcarray.pmc files first.

See also:-
http://www.parrotcode.org/docs/pmc.html
http://www.parrotcode.org/docs/pmc2c.html

Hope this helps - just yell if not.  :-)

Jonathan 


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About