[ANN] malloc'd ByteArrays

Todd Fleming todd at flemingcnc.com
Mon Dec 12 20:24:47 PST 2005


Brian Rice wrote:

> I don't want to give the Image a pointer for safety reasons, and also  
> because it's a pain to have to deal primarily with 32-bit or 64-bit  
> pointers in tagged-pointer space. There's also two words of header  
> overhead for every such value in the image.

ExternalLibrary already exposes raw pointers (stored in byte arrays); 
it's up to libraries such as cairo.slate to encapsulate them.  In this 
case, memoryarea.slate would encapsulate the raw pointer values and 
external interface libraries such as cairo.slate should be the only ones 
to use those values directly.  2 words of overhead doesn't seem that 
bad; malloc.c has 2 words of overhead per block anyway.

Brian Rice wrote:

>
> Ideas? Suggestions? Do you have a patch I can apply? :)

It would be easy on me if there was a function to retrieve the pointer 
value as a byte array, since ExternalLibrary expects it.

If you're interested, I could code up something similar to what you did 
as a plugin tomorrow night as an alternative (seems easier than 
primitives).  It would use the approach that I'm promoting (direct 
pointers, no quantity limits).

Todd




More information about the Slate mailing list