2002-08-17 03:41:39 +08:00
|
|
|
/* cygmalloc.h: cygwin DLL malloc stuff
|
|
|
|
|
2013-01-21 12:34:52 +08:00
|
|
|
Copyright 2002, 2003, 2004, 2005, 2007, 2013 Red Hat, Inc.
|
2002-08-17 03:41:39 +08:00
|
|
|
|
|
|
|
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-01-21 12:34:52 +08:00
|
|
|
#ifndef __reg1
|
|
|
|
# define __reg1 __stdcall __attribute__ ((regparm (1)))
|
|
|
|
#endif
|
|
|
|
#ifndef __reg2
|
|
|
|
# define __reg2 __stdcall __attribute__ ((regparm (2)))
|
|
|
|
#endif
|
2013-01-21 15:42:02 +08:00
|
|
|
#ifndef __reg3
|
|
|
|
# define __reg3 __stdcall __attribute__ ((regparm (3)))
|
2013-01-21 12:34:52 +08:00
|
|
|
#endif
|
|
|
|
void __reg1 dlfree (void *p);
|
|
|
|
void __reg1 *dlmalloc (unsigned size);
|
|
|
|
void __reg2 *dlrealloc (void *p, unsigned size);
|
|
|
|
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
|
|
|
|
|
|
|
#ifndef __INSIDE_CYGWIN__
|
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
|
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
|