Buffer PMC RFC

Peter Lobsinger plobsing at gmail.com
Sat Jun 5 02:17:48 UTC 2010


On Thu, Jun 3, 2010 at 4:57 PM, Vasily Chekalkin <bacek at bacek.com> wrote:
> Hello.
>
> After recent digging into GC guts, work on immutable strings, masak++
> work on strings building I would like to propose next changes in
> parrot core.
>
> 1. Remove "buffers" (which is string-like mutables). They adds a lot
> of complexity to GC (finding them, compacting, etc). And they are
> sharing same storage as strings which isn't good in immutable strings
> world.
>
> 2. Introduce Buffer/BufferIterator PMCs. Buffer will have methods like:
>  a) .push_byte, .push_word for pushing sized integers into it. (May
> be .push_u8, .push_u16 will be better)
>  b) .get_byte, etc to get sized integer at position
>  c) .set_byte
>  b) .encode(encoding) to "convert" buffer into String with predefined
> encoding. Actually it will just create such string and validate it.

I'd like to see this integrated with ManagedStruct/UnManagedStruct (or
whatever they become) at some point as their functionality is very
similar (a view over an arbitrary section of memory).


More information about the parrot-dev mailing list