2002-08-16 21:41:39 +02: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-20 20:36:35 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2013-04-23 11:44:36 +02:00
|
|
|
#include "regparm.h"
|
|
|
|
|
2013-01-21 05:34:52 +01:00
|
|
|
void __reg1 dlfree (void *p);
|
2013-04-23 11:44:36 +02:00
|
|
|
void __reg1 *dlmalloc (size_t size);
|
|
|
|
void __reg2 *dlrealloc (void *p, size_t size);
|
2013-01-21 05:34:52 +01: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-20 20:36:35 +01:00
|
|
|
void dlmalloc_stats ();
|
2002-08-16 21:41:39 +02:00
|
|
|
|
2013-04-23 11:44:36 +02:00
|
|
|
#ifdef __x86_64__
|
|
|
|
#define MALLOC_ALIGNMENT ((size_t)16U)
|
|
|
|
#endif
|
|
|
|
|
2002-08-16 21:41:39 +02:00
|
|
|
#ifndef __INSIDE_CYGWIN__
|
2007-02-08 12:35:52 +01:00
|
|
|
extern "C" void __set_ENOMEM ();
|
2013-04-23 11:44:36 +02:00
|
|
|
void *mmap64 (void *, size_t, int, int, int, off_t);
|
|
|
|
#define mmap mmap64
|
2007-02-08 12:35:52 +01:00
|
|
|
# define MALLOC_FAILURE_ACTION __set_ENOMEM ()
|
2002-08-18 06:13:57 +02:00
|
|
|
# define USE_DL_PREFIX 1
|
2002-08-16 21:41:39 +02:00
|
|
|
#else
|
2005-04-05 06:31:00 +02:00
|
|
|
# define __malloc_lock() mallock.acquire ()
|
|
|
|
# define __malloc_unlock() mallock.release ()
|
|
|
|
extern muto mallock;
|
2002-08-16 21:41:39 +02:00
|
|
|
#endif
|
2004-01-20 20:36:35 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|