<vaninwagen>
ein_ you are right. Sorry about the confusion. The primitive is only used on pony side to associate a certain type with the pointer. It is only used as a type argument.
<vaninwagen>
You can work with pointers that way if the struct is allocated/created in C land.
khan has joined #ponylang
<vaninwagen>
So with the color constructors from your lib that works fine
<vaninwagen>
Such a struct will never be garbage collected though
<vaninwagen>
For such a struct to be properly freed, you either need to do it manually at some point or use a wrapper class and use its finalizer `fun _final()` to free that pointer when the class is garbage collected.
khan has quit [Quit: khan]
khan has joined #ponylang
khan has quit [Client Quit]
khan has joined #ponylang
<vaninwagen>
The type argument has no influence on the memory being occupied by the pointer btw
<vaninwagen>
In this particular case
brainproxy has quit [Ping timeout: 260 seconds]
irx[m] has quit [Ping timeout: 255 seconds]
srenatus has quit [Ping timeout: 240 seconds]
srenatus has joined #ponylang
irx[m] has joined #ponylang
khan has quit [Read error: Connection reset by peer]
khan has joined #ponylang
khan has quit [Ping timeout: 255 seconds]
einStrauch has joined #ponylang
<einStrauch>
@vaninwagen i've read the response after i've left, and that's about what i expected tbh
<einStrauch>
one thing i'm still wondering about, tho, is that the color-struct is not necessarily a pointer per sé
<einStrauch>
and stack-allocated
<einStrauch>
would it not just be discarded on function exit anyway then, like e.G. integer types etc.?
<einStrauch>
incidentally, the rason i'm resisting wrapping it all in a class is that one of the associated functions requests an array of the type
<einStrauch>
having to allocate 2 such arrays, and copy the primitive array into the wrapped one seems incredibly wasteful
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
khan has joined #ponylang
alxs has joined #ponylang
_andre has joined #ponylang
_andre has quit [Client Quit]
_andre has joined #ponylang
khan has quit [Quit: khan]
aturley has joined #ponylang
brainproxy has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
jmiven has quit [Quit: pan]
jmiven has joined #ponylang
endformationage has joined #ponylang
jaro has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
brainproxy has quit [Quit: WeeChat 2.1]
ExtraCrispy has quit [Remote host closed the connection]
einStrauch has quit [Ping timeout: 252 seconds]
alxs has joined #ponylang
alxs has quit [Client Quit]
acarrico has joined #ponylang
alxs has joined #ponylang
khan has joined #ponylang
kempe has quit [Ping timeout: 245 seconds]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
<vaninwagen>
einStrauch in the case of pointers to stack allocated structs you need to take great care with your pointers and not leak them somewhere out of their scope. Maybe you are better off using pony structs instead of pointers?