This is the mail archive of the
mailing list for the libstdc++ project.
sizeof() segfault and mutex initialization?
- From: Stefan Olsson <stefan at snon dot net>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 19 Feb 2003 13:29:00 +0100
- Subject: sizeof() segfault and mutex initialization?
During the rewrite of our allocator into a patch for stl_alloc.h we have
encountered two problems.
1) Compiler segfaults with
alloc_perf_comp_single.cc -static -pthread
In file included from /root/projects/alloc/local/include/c++/3.4/vector:68,
/root/projects/alloc/local/include/c++/3.4/bits/stl_alloc.h: In static
function `static void std::__mt_alloc<__inst>::_S_init()':
internal compiler error: Segmentation
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
when doing a sizeof inside a template method:
_S_thread_freelist_mutex = (__gthread_mutex_t*)malloc (sizeof
It's possible to do sizeof on structs defined inside the template class,
but not on for instance int or - what we really want to do -
__gthread_mutex_t. This seems to be the PR7112. Any work arounds?
2) gthr does not implement a __gthread_mutex_init () function, only a
static initializer. However we need to create 1-n mutexes - one per bin
- during initialization code. How can this be done? Is it possible/ok to
Experience is what you get when you were expecting something else.