Commit 40aa4dc4 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr90: Added _recalloc implementation.

parent 32b1f25f
......@@ -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
......
......@@ -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;
}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment