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
|
2013-04-23 17:44:36 +08:00
|
|
|
#include "regparm.h"
|
|
|
|
|
2013-01-21 12:34:52 +08:00
|
|
|
void __reg1 dlfree (void *p);
|
2013-04-23 17:44:36 +08:00
|
|
|
void __reg1 *dlmalloc (size_t size);
|
|
|
|
void __reg2 *dlrealloc (void *p, size_t size);
|
2013-01-21 12:34:52 +08:00
|
|
|
void __reg2 *dlcalloc (size_t nmemb, size_t size);
|
|
|
|
void __reg2 *dlmemalign (size_t alignment, size_t bytes);
|
|
|
|
void __reg1 *dlvalloc (size_t bytes);
|
|
|
|
size_t __reg1 dlmalloc_usable_size (void *p);
|
|
|
|
int __reg1 dlmalloc_trim (size_t);
|
|
|
|
int __reg2 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
|
|
|
#ifdef __x86_64__
|
|
|
|
#define MALLOC_ALIGNMENT ((size_t)16U)
|
|
|
|
#endif
|
|
|
|
|
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 ();
|
2013-04-23 17:44:36 +08:00
|
|
|
void *mmap64 (void *, size_t, int, int, int, off_t);
|
2016-08-20 22:03:14 +08:00
|
|
|
# define mmap mmap64
|
2007-02-08 19:35:52 +08:00
|
|
|
# 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
|