mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
The purpose is to link to this library for wine modules that use only malloc/free/calloc/_recalloc, so they don't require to be linked to msvcrt.
24 lines
555 B
C
24 lines
555 B
C
/*
|
|
* PROJECT: ReactOS CRT heap support library
|
|
* LICENSE: MIT (https://spdx.org/licenses/MIT)
|
|
* PURPOSE: Implementation of realloc
|
|
* COPYRIGHT: Copyright 2026 Timo Kreuzer <[email protected]>
|
|
*/
|
|
|
|
#include <malloc.h>
|
|
#include <windef.h>
|
|
#include <winbase.h>
|
|
|
|
void* __cdecl realloc(void* Block, size_t Size)
|
|
{
|
|
if (Block == NULL)
|
|
return HeapAlloc(GetProcessHeap(), 0, Size);
|
|
|
|
if (Size != 0)
|
|
return HeapReAlloc(GetProcessHeap(), 0, Block, Size);
|
|
|
|
HeapFree(GetProcessHeap(), 0, Block);
|
|
|
|
return NULL;
|
|
}
|