Pointers in Slate.
Brian Rice
water at tunes.org
Wed Nov 10 11:07:52 PST 2004
ByteArrays are also suitable, although with a one-word pointer, the
overhead (2 extra words, I believe) is substantial by comparison with a
SmallInteger.
About finalizers, yes. Resources should be pushed into a collection
whose elements are then re-initialized (mostly opened) on the next
startup, as well as of course being closed on shutting down.
Right now there are no startup or shutdown hooks, and I am aiming to
provide these once Slate supports concurrency.
On Nov 10, 2004, at 10:51 AM, Todd Fleming wrote:
> How about storing it in a byte array?
>
> This brings up a related question. Will Slate provide finallizers for
> dealing with external resources?
>
> Todd
>
> Michael Walter wrote:
>
>> Two obvious possibilities:
>> - You do it as file.c does (large static array & return the index as
>> handles)
>> - You return the pointer casted to LongInt, which is kind of fugly for
>> several reasons, though.
>>
>> Cheers,
>> Michael
>>
>>
>> On Wed, 10 Nov 2004 15:44:54 -0300, Pupeno <pupeno at pupeno.com> wrote:
>>
>>> I started working in a Cairo/X backend (I need a couple of xlib
>>> calls, so, I'm
>>> making a backend for those calls as well). I'm making the xlib
>>> wrapper
>>> separatly of the cairo wrapper so if someone wants to use the xlib
>>> wrapper
>>> and not use the cair wrapper, he/she can.
>>> I'm starting bit by bit... based on a cairo program that draws a
>>> spline.
>>> The first thing the cairo program does is this:
>>> Display *dpy = XOpenDisplay(0);
>>> So I made a wrapper for XOpenDisplay... I pass a byte array to it
>>> that is
>>> decoded to a char* (that 0 is a char*), but then, what do I do with
>>> dpy ?
>>> Should I pass it back to Slate ? should I make an array of opened
>>> displays ?
>>> I then will have a lot of other pointers... most of the time I don't
>>> care
>>> what's inside... it is just for passing arround.
>>> Thanks.
>>> --
>>> Pupeno: pupeno at pupeno.com - http://www.pupeno.com
>>>
>>>
>
>
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
More information about the Slate
mailing list