lua-users home
lua-l archive

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


A TAG wrapper around lua5's userdata could be handy in porting
lua4 applications to lua5. But a hack is hack, no matter
how clever it is. At least for me, I don't see much advantage
in doing so. Extra wrapper for thousands of userdata used
in my program could be a serious overhead.

The real question is, can lua5 be improved to deal with 
heavy-weight userdata without using Lua's own malloc?

Regards, 
.paul.

On Wed, Jan 29, 2003 at 02:10:19AM -0500, Michael Naunton wrote:
> Alex Bilyk wrote:
> 
> >Michael Naunton wrote:
> >I'd like enlightenment too. I currently just punted and wrote a C++
> >wrapper template to push userdata as a T*, classTag pair. That way I can
> >at least allocate my real data in mempools, etc, and vector GC stuff to
> >the real class. Ugly as hell, but at least the ugliness is contained.
> >
> >I don't quite understand how you can save on full user data allocations
> >using <class*, tag> pairs. You would still need to have a full user data
> >per pair, wouldn't you? You could wire it to a single "__gc" handler,
> >but allocations... Hmm.
> >
> Sorry to not make myself clear - I accept the full user data
> allocations. I just stick it in a wrapper hoping that either a) the
> overhead will not prove to be too high, or b) someone will enlighten me
> and then I rewrite my wrapper class.
>