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
|
|
|
|
|
2002-08-17 03:41:39 +08:00
|
|
|
#ifndef __INSIDE_CYGWIN__
|
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);
|
|
|
|
#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
|
2002-08-17 03:41:39 +08:00
|
|
|
#else
|
2005-04-05 12:31:00 +08:00
|
|
|
# define __malloc_lock() mallock.acquire ()
|
|
|
|
# define __malloc_unlock() mallock.release ()
|
|
|
|
extern muto mallock;
|
2002-08-17 03:41:39 +08:00
|
|
|
#endif
|
2004-01-21 03:36:35 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|