2002-08-17 03:41:39 +08:00
|
|
|
/* cygmalloc.h: cygwin DLL malloc stuff
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2004-01-21 03:36:35 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2022-05-24 03:52:52 +08:00
|
|
|
|
|
|
|
void dlfree (void *p);
|
|
|
|
void *dlmalloc (size_t size);
|
|
|
|
void *dlrealloc (void *p, size_t size);
|
|
|
|
void *dlcalloc (size_t nmemb, size_t size);
|
|
|
|
void *dlmemalign (size_t alignment, size_t bytes);
|
|
|
|
void *dlvalloc (size_t bytes);
|
|
|
|
size_t dlmalloc_usable_size (void *p);
|
|
|
|
int dlmalloc_trim (size_t);
|
|
|
|
int dlmallopt (int p, int v);
|
2004-01-21 03:36:35 +08:00
|
|
|
void dlmalloc_stats ();
|
2002-08-17 03:41:39 +08:00
|
|
|
|
2013-04-23 17:44:36 +08:00
|
|
|
#define MALLOC_ALIGNMENT ((size_t)16U)
|
|
|
|
|
2016-08-20 22:03:14 +08:00
|
|
|
#if defined (DLMALLOC_VERSION) /* Building malloc.cc */
|
|
|
|
|
2007-02-08 19:35:52 +08:00
|
|
|
extern "C" void __set_ENOMEM ();
|
|
|
|
# define MALLOC_FAILURE_ACTION __set_ENOMEM ()
|
2002-08-18 12:13:57 +08:00
|
|
|
# define USE_DL_PREFIX 1
|
2016-08-20 22:03:14 +08:00
|
|
|
|
|
|
|
#elif defined (__INSIDE_CYGWIN__)
|
|
|
|
|
2021-10-26 23:53:08 +08:00
|
|
|
# define __malloc_lock() AcquireSRWLockExclusive (&mallock)
|
|
|
|
# define __malloc_trylock() TryAcquireSRWLockExclusive (&mallock)
|
|
|
|
# define __malloc_unlock() ReleaseSRWLockExclusive (&mallock)
|
|
|
|
extern SRWLOCK NO_COPY mallock;
|
|
|
|
void malloc_init ();
|
2016-08-20 22:03:14 +08:00
|
|
|
|
2002-08-17 03:41:39 +08:00
|
|
|
#endif
|
2016-08-20 22:03:14 +08:00
|
|
|
|
2004-01-21 03:36:35 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|