msvcr90: Added _recalloc implementation.

This commit is contained in:
Piotr Caban 2010-04-26 12:33:02 +02:00 committed by Alexandre Julliard
parent 32b1f25f4b
commit 40aa4dc459
3 changed files with 29 additions and 2 deletions

View File

@ -837,7 +837,7 @@
@ stub _pwctype
@ cdecl _read(long ptr long) msvcrt._read
@ stub _realloc_crt
@ stub _recalloc
@ cdecl _recalloc(ptr long long) msvcr90._recalloc
@ stub _recalloc_crt
@ stub _resetstkoflw
@ cdecl _rmdir(str) msvcrt._rmdir

View File

@ -21,6 +21,8 @@
#include <stdarg.h>
#include "stdlib.h"
#include "errno.h"
#include "malloc.h"
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
@ -131,3 +133,28 @@ void CDECL __clean_type_info_names_internal(void *p)
{
FIXME("(%p) stub\n", p);
}
/*********************************************************************
* _recalloc (MSVCR90.@)
*/
void* CDECL _recalloc(void* mem, size_t num, size_t size)
{
size_t old_size;
void *ret;
if(!mem)
return calloc(num, size);
size = num*size;
old_size = _msize(mem);
ret = realloc(mem, size);
if(!ret) {
*_errno() = ENOMEM;
return NULL;
}
if(size>old_size)
memset((BYTE*)mem+old_size, 0, size-old_size);
return ret;
}

View File

@ -823,7 +823,7 @@
@ stub _pwctype
@ cdecl _read(long ptr long) msvcrt._read
@ stub _realloc_crt
@ stub _recalloc
@ cdecl _recalloc(ptr long long)
@ stub _recalloc_crt
@ stub _resetstkoflw
@ cdecl _rmdir(str) msvcrt._rmdir