lua-users home
lua-l archive

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


The first argument is  &p, not p , so we don't need malloc.

btw, I use intptr_t to convert now.

在 2012年4月11日 下午3:17,siney <siney@yeah.net> 写道:
> hi, cloud,
>
> Thanks for your great work, I have read code , I found a problem about
> pushint64, pls read code below,
>
> static void_pushint64(lua_State *L, int64_t n) {
> void * p = NULL;    // I think you should malloc sizeof(int64) memory?
> memcpy(&p, &n , sizeof(p));
> lua_pushlightuserdata(L,p);
> }
>
> ________________________________
> siney
>
> From: 云风
> Date: 2012-04-11 15:03
> To: Lua mailing list
> Subject: int64 support in 64bit architecture
> We use int64 in our project, but lua don't support it directly.
> I think in 64bit architecture , use lightuserdata as the 64bit integer
> number is a simple way . So I wrote this library :
>
> https://github.com/cloudwu/lua-int64
>
> I hope it would be helpful .
>
> --
> http://blog.codingnow.com
>



-- 
http://blog.codingnow.com