Re: [QUESTION] PMC Pre-allocation

2006-10-27 Thread Allison Randal
Pulled from the archive at Leo's request (thanks Leo). Leopold Toetsch wrote: It originated in a perl5-ism in the first array implementations, following the perl-way: $elems = scalar @array; which was directly translated to: set I0, P0 This works at least for "small" arrays. The prob

Re: [QUESTION] PMC Pre-allocation

2006-10-19 Thread Karl Forner
On 10/18/06, Leopold Toetsch <[EMAIL PROTECTED]> wrote: IMHO the only way to get rid of this historical confusion is: - disable the set opcode for arrays by throwing an exception in the vtable - use elements for getting .elems only - implement 2 new opcodes elements P0, I0# fill with defa

Re: [QUESTION] PMC Pre-allocation

2006-10-18 Thread Leopold Toetsch
Am Mittwoch, 18. Oktober 2006 01:35 schrieb Karl Forner: > Hi, > > Is there a way to specify a minimum allocation size for PMCs like strings > or arrays ? > Something like in perl : %h = 1000 ? > > It could boost execution times when you have a good idea of the space you > need. > For example, I'd