lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> >2) I'd change the default number type from double to float.  Yeah, 
> >yeah, I know I can #define it, but the truth is, it doesn't 
> work in Lua 
> >4.1 Alpha.  :)  (Amped crashes...)
> >4) I'd also have a 32-bit void pointer type.  Amped doesn't use Lua 
> >userdata, because the cost of the allocation and subsequent garbage 
> >collection for a simple pointer passthrough (C->Lua->C 
> callback) is too 
> >high.  Instead, it takes advantage of the precision of the 
> double type 
> >to pass memory pointers to Lua and back up to C.
> Perhaps this is exactly why Amped crashes with 32-bit floats? because 
> your passed-through pointers get corrupted?

Nah.  I tried the float thing before passing the void pointers through
as doubles (when everything was still user data).  I was actually going
to add the void pointer type to the Value structure, but when I realized
I couldn't use floats (and there was no time to determine why), I just
emulated them with the doubles.