Example #1
0
File: heap.c Project: Eltechs/wine
/*********************************************************************
 * _recalloc (MSVCR100.@)
 */
void* CDECL _recalloc(void *mem, MSVCRT_size_t num, MSVCRT_size_t size)
{
    MSVCRT_size_t old_size;
    void *ret;

    if(!mem)
        return MSVCRT_calloc(num, size);

    size = num*size;
    old_size = _msize(mem);

    ret = MSVCRT_realloc(mem, size);
    if(!ret) {
        *MSVCRT__errno() = MSVCRT_ENOMEM;
        return NULL;
    }

    if(size>old_size)
        memset((BYTE*)ret+old_size, 0, size-old_size);
    return ret;
}
Example #2
0
File: heap.c Project: iXit/wine
/*********************************************************************
 *		_calloc_base (UCRTBASE.@)
 */
void* CDECL _calloc_base(MSVCRT_size_t count, MSVCRT_size_t size)
{
  return MSVCRT_calloc(count, size);
}