Module: wine Branch: master Commit: 926433faa325dd075f03b12d4831eae607bae7f2 URL: https://gitlab.winehq.org/wine/wine/-/commit/926433faa325dd075f03b12d4831eae...
Author: Alex Henrie alexhenrie24@gmail.com Date: Wed Dec 7 22:14:11 2022 -0700
include: Add corecrt_malloc.h.
---
include/Makefile.in | 1 + include/msvcrt/corecrt_malloc.h | 47 +++++++++++++++++++++++++++++++++++++++++ include/msvcrt/malloc.h | 14 +----------- include/msvcrt/stdlib.h | 5 +---- 4 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/include/Makefile.in b/include/Makefile.in index 27c06a30906..d0ae4b4667e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -474,6 +474,7 @@ SOURCES = \ msvcrt/conio.h \ msvcrt/corecrt.h \ msvcrt/corecrt_io.h \ + msvcrt/corecrt_malloc.h \ msvcrt/corecrt_startup.h \ msvcrt/corecrt_stdio_config.h \ msvcrt/corecrt_wctype.h \ diff --git a/include/msvcrt/corecrt_malloc.h b/include/msvcrt/corecrt_malloc.h new file mode 100644 index 00000000000..1478a6a6c89 --- /dev/null +++ b/include/msvcrt/corecrt_malloc.h @@ -0,0 +1,47 @@ +/* + * Heap definitions + * + * Copyright 2001 Francois Gouget. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_CORECRT_MALLOC_H +#define __WINE_CORECRT_MALLOC_H + +#include <corecrt.h> + +#ifdef __cplusplus +extern "C" { +#endif + +_ACRTIMP void* __cdecl calloc(size_t,size_t); +_ACRTIMP void __cdecl free(void*); +_ACRTIMP void* __cdecl malloc(size_t); +_ACRTIMP void* __cdecl realloc(void*,size_t); + +_ACRTIMP void* __cdecl _expand(void*,size_t); +_ACRTIMP size_t __cdecl _msize(void*); + +_ACRTIMP void __cdecl _aligned_free(void*); +_ACRTIMP void* __cdecl _aligned_malloc(size_t,size_t); +_ACRTIMP void* __cdecl _aligned_offset_malloc(size_t,size_t,size_t); +_ACRTIMP void* __cdecl _aligned_realloc(void*,size_t,size_t); +_ACRTIMP void* __cdecl _aligned_offset_realloc(void*,size_t,size_t,size_t); + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_CORECRT_MALLOC_H */ diff --git a/include/msvcrt/malloc.h b/include/msvcrt/malloc.h index fcbadbeb4e0..359ef4578e9 100644 --- a/include/msvcrt/malloc.h +++ b/include/msvcrt/malloc.h @@ -21,6 +21,7 @@ #define __WINE_MALLOC_H
#include <corecrt.h> +#include <corecrt_malloc.h>
/* heap function constants */ #define _HEAPEMPTY -1 @@ -54,25 +55,12 @@ extern unsigned int _amblksiz; extern "C" { #endif
-_ACRTIMP void* __cdecl _expand(void*,size_t); _ACRTIMP int __cdecl _heapadd(void*,size_t); _ACRTIMP int __cdecl _heapchk(void); _ACRTIMP int __cdecl _heapmin(void); _ACRTIMP int __cdecl _heapset(unsigned int); _ACRTIMP size_t __cdecl _heapused(size_t*,size_t*); _ACRTIMP int __cdecl _heapwalk(_HEAPINFO*); -_ACRTIMP size_t __cdecl _msize(void*); - -_ACRTIMP void* __cdecl calloc(size_t,size_t); -_ACRTIMP void __cdecl free(void*); -_ACRTIMP void* __cdecl malloc(size_t); -_ACRTIMP void* __cdecl realloc(void*,size_t); - -_ACRTIMP void __cdecl _aligned_free(void*); -_ACRTIMP void* __cdecl _aligned_malloc(size_t,size_t); -_ACRTIMP void* __cdecl _aligned_offset_malloc(size_t,size_t,size_t); -_ACRTIMP void* __cdecl _aligned_realloc(void*,size_t,size_t); -_ACRTIMP void* __cdecl _aligned_offset_realloc(void*,size_t,size_t,size_t);
_ACRTIMP size_t __cdecl _get_sbh_threshold(void); _ACRTIMP int __cdecl _set_sbh_threshold(size_t size); diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index c52423523f7..e7dd2caefc4 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -8,6 +8,7 @@ #ifndef __WINE_STDLIB_H #define __WINE_STDLIB_H
+#include <corecrt_malloc.h> #include <corecrt_wstdlib.h> #include <limits.h>
@@ -208,23 +209,19 @@ _ACRTIMP int __cdecl atoi(const char*); _ACRTIMP int __cdecl _atoi_l(const char*,_locale_t); _ACRTIMP __msvcrt_long __cdecl atol(const char*); _ACRTIMP __int64 __cdecl atoll(const char*); -_ACRTIMP void* __cdecl calloc(size_t,size_t); #ifndef __i386__ _ACRTIMP div_t __cdecl div(int,int); _ACRTIMP ldiv_t __cdecl ldiv(__msvcrt_long,__msvcrt_long); #endif _ACRTIMP lldiv_t __cdecl lldiv(__int64,__int64); _ACRTIMP DECLSPEC_NORETURN void __cdecl exit(int); -_ACRTIMP void __cdecl free(void*); _ACRTIMP char* __cdecl getenv(const char*); _ACRTIMP __msvcrt_long __cdecl labs(__msvcrt_long); _ACRTIMP __int64 __cdecl llabs(__int64); -_ACRTIMP void* __cdecl malloc(size_t); _ACRTIMP int __cdecl mblen(const char*,size_t); _ACRTIMP void __cdecl perror(const char*); _ACRTIMP int __cdecl rand(void); _ACRTIMP errno_t __cdecl rand_s(unsigned int*); -_ACRTIMP void* __cdecl realloc(void*,size_t); _ACRTIMP void __cdecl srand(unsigned int); _ACRTIMP float __cdecl strtof(const char*,char**); _ACRTIMP double __cdecl strtod(const char*,char**);