* cygheap.cc (_cmalloc): Use correct constants for size calculation.

* dcrt0.cc (dll_crt0_1): Move uid initialization earlier.
* fork.cc (fork_parent): Move cygheap_setup_in_child to just prior to
CreateProcess so that all contents of cygheap are copied.
* spawn.cc (spawn_guts): Ditto.
This commit is contained in:
Christopher Faylor
2001-07-18 17:05:34 +00:00
parent c9fbce2641
commit 16828fc5d4
5 changed files with 17 additions and 7 deletions

View File

@@ -167,10 +167,11 @@ static void *__stdcall
_cmalloc (int size)
{
_cmalloc_entry *rvc;
int b, sz;
unsigned b, sz;
/* Calculate "bit bucket" and size as a power of two. */
for (b = 3, sz = 8; sz && sz < (size + 4); b++, sz <<= 1)
for (b = 3, sz = 8; sz && sz < (size + sizeof (_cmalloc_entry));
b++, sz <<= 1)
continue;
cygheap_protect->acquire ();