lua-users home
lua-l archive

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


>     // >>>>  Original code: block = l_realloc(block, oldsize, size);
>          if(block == NULL)
>         {
>                 block = HeapAlloc(GetProcessHeap(),0,size);
>         } else
>         {
>                 block = HeapReAlloc(GetProcessHeap(),0,block,size);
>         }
> 
> 
> What about this?
> 
>   #define l_realloc(b,o,s) (b==NULL) ? HeapAlloc(GetProcessHeap(),0,s) : \                                    
> 							HeapReAlloc(GetProcessHeap(),0,b,s)

I like that!  I think I'll use it.  That's why I like this list; most of the folks on it are smarter than me :)

The problem still remains that any extension DLL that my application links with will need to be compiled with the version of the static Lua library that defines this macro.  But that's not your problem, it's mine.  Thanks for the response.

- Brett