This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Possible cause of WaitForMultipleObjects error message


>> Until then, you are mixing metaphors if you are using fork() with
>> Windows memory allocation calls.
>
>Does that mean that if a cygwin app calls a DLL which calls HeapAlloc,
>the app will be unable to fork()?

I haven't studied this in great detail, but, no, this doesn't necessarily
follow.  It does mean that any memory allocated using HeapAlloc will not
be duplicated in the forked process.

The "split heap" is detected by sbrk.  When it attempts to grow the
cygwin heap, it notices if the end of memory is the same as the last
time it was called.  If it isn't, some other function has extended the
*Windows* heap and the *cygwin* heap is marked as split.

So, you will not necessarily receive the split heap error unless you follow
the HeapAlloc with a call to sbrk.  malloc calls sbrk when it is out of
memory.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]