* cygheap.h (init_cygheap): Move bucket array here from cygheap.cc.

* cygheap.cc: Throughout use bucket array from cygheap.
* sigproc.cc (proc_subproc): Dynamically allocate zombie buffer to save DLL
space.
(sigproc_fixup_after_fork): Free zombie array after a fork.
* sigproc.h (sigproc_fixup_after_fork): Declare.
* dir.cc (mkdir): Expand buffer for security descriptor to 4K to avoid stack
corruption.
* fhandler.cc (fhandler_base::open): Ditto.
* path.cc (symlink): Ditto.
This commit is contained in:
Christopher Faylor
2001-09-06 03:39:18 +00:00
parent 0fb61528c9
commit 4ce15a4980
11 changed files with 49 additions and 18 deletions

View File

@@ -35,9 +35,7 @@ struct cygheap_entry
char data[0];
};
#define NBUCKETS 32
static char *buckets[NBUCKETS] = {0};
#define NBUCKETS (sizeof (cygheap->buckets) / sizeof (cygheap->buckets[0]))
#define N0 ((_cmalloc_entry *) NULL)
#define to_cmalloc(s) ((_cmalloc_entry *) (((char *) (s)) - (int) (N0->data)))
@@ -202,10 +200,10 @@ _cmalloc (int size)
continue;
cygheap_protect->acquire ();
if (buckets[b])
if (cygheap->buckets[b])
{
rvc = (_cmalloc_entry *) buckets[b];
buckets[b] = rvc->ptr;
rvc = (_cmalloc_entry *) cygheap->buckets[b];
cygheap->buckets[b] = rvc->ptr;
rvc->b = b;
}
else
@@ -227,8 +225,8 @@ _cfree (void *ptr)
cygheap_protect->acquire ();
_cmalloc_entry *rvc = to_cmalloc (ptr);
DWORD b = rvc->b;
rvc->ptr = buckets[b];
buckets[b] = (char *) rvc;
rvc->ptr = cygheap->buckets[b];
cygheap->buckets[b] = (char *) rvc;
cygheap_protect->release ();
}