This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Jemalloc under CYGWIN
- From: Yucong Sun <sunyucong at gmail dot com>
- To: corinna-cygwin at cygwin dot com, cygwin-developers at cygwin dot com, cygwin at cygwin dot com
- Date: Wed, 21 Oct 2015 21:49:56 +0800
- Subject: Re: Jemalloc under CYGWIN
- Authentication-results: sourceware.org; auth=none
- References: <CAJygYd2T9JSJCDT178F8mzmuA79MsBbWCLsr8eF7Aguxk_-YWQ at mail dot gmail dot com> <CAJygYd1tU+Nc5+owTw0Lfuk8SWQQS2vE1mhKjoz5br4c9zVF8A at mail dot gmail dot com> <20151021105300 dot GN5319 at calimero dot vinschen dot de>
> What exactly is the malloc problem you're seeing?
The specific problem I'm having is that jemalloc's malloc_init() calls
needs to use pthread_mutex_init() or even pthread_mutex with a
initializer. Both in-turn uses malloc, triggering this issue.
A quick fix would be somehow make pthread always use system
malloc/free, which shouldn't be that bad.
Another issue I saw is that jemalloc will use readlink() for
"/etc/jemalloc.conf" during malloc_init(), which on cygwin, this
function uses "new" to do some path manipulating work, which also have
the same issue. However, we can probably just disable that .
So, the quickest fix would be to make cygwin's thread implementations
always use system malloc.
some small workarounds in jemalloc would be needed afterwards, but it
should be a nice starting point.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple