1 /* cygmalloc.h: cygwin DLL malloc stuff
3 Copyright 2002, 2003, 2004, 2005, 2007 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
14 void dlfree (void *p) __attribute__ ((regparm (1)));
15 void *dlmalloc (unsigned size) __attribute__ ((regparm (1)));
16 void *dlrealloc (void *p, unsigned size) __attribute__ ((regparm (2)));
17 void *dlcalloc (size_t nmemb, size_t size) __attribute__ ((regparm (2)));
18 void *dlmemalign (size_t alignment, size_t bytes) __attribute__ ((regparm (2)));
19 void *dlvalloc (size_t bytes) __attribute__ ((regparm (1)));
20 size_t dlmalloc_usable_size (void *p) __attribute__ ((regparm (1)));
21 int dlmalloc_trim (size_t) __attribute__ ((regparm (1)));
22 int dlmallopt (int p, int v) __attribute__ ((regparm (2)));
23 void dlmalloc_stats ();
25 #ifndef __INSIDE_CYGWIN__
26 extern "C" void __set_ENOMEM ();
27 # define MALLOC_FAILURE_ACTION __set_ENOMEM ()
28 # define USE_DL_PREFIX 1
30 # define __malloc_lock() mallock.acquire ()
31 # define __malloc_unlock() mallock.release ()