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)

-- Roberto