src/list.c is the base for several array-ish PMC inside classes. But
it's mostly outdone by other PMCs like ResizableIntegerPMC.
OTOH it has some features which are not covered by other array classes:
- implementation of splice, shift, unshift, ...
- chunked allocation with (limited) support for sparse arrays
- much faster shift/unshift for big arrays
I think we should do:
1) implement missing vtables (shift,unshift,splice,push,pop,delete) in
*all* {Fixed,Resizable}<type>Array PMCs
2) cleanup and simplify list.c. E.g. the growing policy for allocation
can be dropped. We need only fixed-sized chunks of e.g one page size
(and maybe sparse chunks).
3) get rid of Parrot_allocate* inside list.c because on each GC run the
memory might move. We just use mem_sys_allocate (_realloc) instead.
4) treat list.c just as another policy: namely chunked array storage and
use it when necessary. That is:
- new (small) arrays start as one of the mentioned types in 1)
- if the array gets big or has considerable shift/unshift operations,
switch the array vtable to use the chunked based approach of list.c
where the existing allocated memory is just one list chunk.
These are several more or less independent steps, 1) and 2+3) can be
done in parallel.
Takers wanted & thanks
leo