aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/cygheap.h
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-09-30 04:54:11 +0000
committerChristopher Faylor <me@cgf.cx>2000-09-30 04:54:11 +0000
commit8d82847a29d4717e225c56bda43a99ec703e2836 (patch)
treef8ab3ea68e096b050c4a4ddc5ce5e8bfe70633ec /winsup/cygwin/cygheap.h
parent90fe77395a80903e2bec1b00534b442082dfe4b2 (diff)
downloadnewlib-8d82847a29d4717e225c56bda43a99ec703e2836.zip
newlib-8d82847a29d4717e225c56bda43a99ec703e2836.tar.gz
newlib-8d82847a29d4717e225c56bda43a99ec703e2836.tar.bz2
* cygheap.cc (init_cheap): Set aside space for heap walk pointer.
(_csbrk): Make logic for detecting when to alloc cognizant of initialization condition. (_cmalloc): Use a structure to hold bucket size and heap chain pointer. Store pointer to next freed block in bucket size location so that it will be easy to see if a block is allocated. (_cfree): Store pointer to next freed block in bucket size location. (_crealloc): Use macro to retrieve bucket size. (cygheap_init): Eliminate. (cygheap_fixup_in_child): Add second argument to determine if we were execed or not. In execed case, walk the heap, cleaning up any orphaned blocks. * cygheap.h: Add a "MAX" value to cygheap_types. Remove cygheap_init declaration. Accomodate new argument to cygheap_fixup_in child. * fork.cc (fork): Accomodate extra argument to cygheap_fixup_in_child. * dcrt0.cc (dll_crt0_1): Ditto. Remove call to cygheap_init.
Diffstat (limited to 'winsup/cygwin/cygheap.h')
-rw-r--r--winsup/cygwin/cygheap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index 47493ce..18a4a6b 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -20,7 +20,8 @@ enum cygheap_types
HEAP_1_STR,
HEAP_1_ARGV,
HEAP_1_BUF,
- HEAP_1_EXEC
+ HEAP_1_EXEC,
+ HEAP_1_MAX = 100
};
#define CYGHEAPSIZE ((1000 * sizeof (fhandler_union)) + (2 * 65536))
@@ -30,10 +31,9 @@ extern HANDLE cygheap_max;
#define incygheap(s) (cygheap && ((char *) (s) >= (char *) cygheap) && ((char *) (s) <= ((char *) cygheap) + CYGHEAPSIZE))
-void cygheap_init ();
extern "C" {
void __stdcall cfree (void *);
-void __stdcall cygheap_fixup_in_child (HANDLE);
+void __stdcall cygheap_fixup_in_child (HANDLE, bool);
void *__stdcall cmalloc (cygheap_types, DWORD);
void *__stdcall crealloc (void *, DWORD);
void *__stdcall ccalloc (cygheap_types, DWORD, DWORD);