* 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:
@@ -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 ();
|
||||
|
Reference in New Issue
Block a user