public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "random at adriver dot ru" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/29179] New: bugs in mt_allocator Date: Fri, 22 Sep 2006 10:31:00 -0000 [thread overview] Message-ID: <bug-29179-13287@http.gcc.gnu.org/bugzilla/> (raw) This example will demonstrate 2 problems in mt_allocator.cc: ---------------- typedef __gnu_cxx::__mt_alloc<char> allocator_type; typedef __gnu_cxx::__pool_base::_Tune tune_type; allocator_type mt_char; tune_type t(8, 40000, 8, (50000 - 4 * sizeof(void*)), 4096, 10, false); mt_char._M_set_options(t); allocator_type::pointer pc = mt_char.allocate(40000); ---------------- First bug in __pool<..>::_M_initialize(): Binmap_type __bin_max = _M_options._M_min_bin; // not correct. size_t __bin_max = _M_options._M_min_bin; // correct. Second bug in __pool<..>::_M_reserve_block(): while (--__block_count > 0) // not correct because __block_count may be equal 0(and size_t is unsigned) { __c += __bin_size; __block->_M_next = reinterpret_cast<_Block_record*>(__c); __block = __block->_M_next; } while (__block_count > 0) // correct { __c += __bin_size; __block->_M_next = reinterpret_cast<_Block_record*>(__c); __block = __block->_M_next; --__block_count; } -- Summary: bugs in mt_allocator Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: random at adriver dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29179
next reply other threads:[~2006-09-22 10:31 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-09-22 10:31 random at adriver dot ru [this message] 2006-09-22 11:19 ` [Bug libstdc++/29179] " pcarlini at suse dot de 2006-09-22 13:32 ` random at adriver dot ru 2006-09-22 13:42 ` pcarlini at suse dot de 2006-09-22 14:40 ` random at adriver dot ru 2006-09-22 14:48 ` pcarlini at suse dot de 2006-09-22 16:04 ` pinskia at gcc dot gnu dot org 2006-09-25 10:05 ` paolo at gcc dot gnu dot org 2006-09-25 10:06 ` paolo at gcc dot gnu dot org 2006-09-25 10:07 ` pcarlini at suse dot de
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-29179-13287@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).