From a4785603b85b80ea0cc5ea0038bbbb3a13513714 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 14 Nov 2000 05:53:32 +0000 Subject: * cygheap.h (init_cygheap): New struct holding values that live in the Cygwin heap. * child_info.h (child_info): Change pointer type of cygheap to init_cygheap. * cygheap.cc (init_cheap): Point cygheap_max after contents of cygheap. Move some stuff into cygheap.h. * dir.cc (opendir): Change to use root and rootlen in cygheap rather than in myself. (mkdir): Change to use umask in cygheap rather than in myself. * path.cc: Ditto, throughout. * syscalls.cc (_open): Ditto. Change to use umask in cygheap rather than in myself. (chroot): Change to allocate root dir on the cygwin heap. (umask): Change to use umask in cygheap rather than in myself. (cygwin_bind): Ditto. * sigproc.cc (proc_subproc): Don't copy umask or root stuff as this happens automatically now. * pinfo.h (_pinfo): Migrate stuff out of here and into init_cheap. * dcrt0.cc (dll_crt0_1): Call cygheap_init later in startup for first cygwin process. --- winsup/cygwin/cygheap.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/cygheap.h') diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index 8ed3aa3bc..faa50bf12 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -24,13 +24,36 @@ enum cygheap_types HEAP_1_MAX = 100 }; -#define CYGHEAPSIZE ((2000 * sizeof (fhandler_union)) + (2 * 65536)) - -extern HANDLE cygheap; -extern HANDLE cygheap_max; +#define CYGHEAPSIZE ((4000 * sizeof (fhandler_union)) + (2 * 65536)) #define incygheap(s) (cygheap && ((char *) (s) >= (char *) cygheap) && ((char *) (s) <= ((char *) cygheap_max))) +struct _cmalloc_entry +{ + union + { + DWORD b; + char *ptr; + }; + struct _cmalloc_entry *prev; + char data[0]; +}; + + +struct init_cygheap +{ + _cmalloc_entry *chain; + struct + { + size_t rootlen; + char *root; + }; + mode_t umask; +}; + +extern init_cygheap *cygheap; +extern void *cygheap_max; + extern "C" { void __stdcall cfree (void *) __attribute__ ((regparm(1))); void __stdcall cygheap_fixup_in_child (HANDLE, bool); -- cgit v1.2.3