From mboxrd@z Thu Jan 1 00:00:00 1970 From: bjornw@planetarion.com To: gcc-gnats@gcc.gnu.org Subject: libstdc++/4219: stl_alloc using -D__USE_MALLOC fails Date: Tue, 04 Sep 2001 01:46:00 -0000 Message-id: <20010904084010.14630.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00060.html List-Id: >Number: 4219 >Category: libstdc++ >Synopsis: stl_alloc using -D__USE_MALLOC fails >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Sep 04 01:46:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: bjornw@planetarion.com >Release: gcc version 3.1 20010901 (experimental) >Organization: >Environment: redhat-6.2 (all pacthed up june 2001), kernel-2.4.9 >Description: I have a heavy multithreaded application (database server proxy with connection pooling) using stl and friends. Historically gcc-2 leaked memory while using builtin memory allocation scheme. Using -D__USE_MALLOC enforcing simple memory allocation classes was the only way to make my servers live for more than 5 minutes without eating up 500MB RAM. g++ fails to compile anything cause a bug in stl_alloc.h >How-To-Repeat: Compile a program using -D__USE_MALLOC >Fix: stl_alloc.h: 258 Original code: # ifdef __USE_MALLOC typedef malloc_alloc alloc;# ifdef __USE_MALLOC typedef malloc_alloc single_client_alloc; #else Change this into: # ifdef __USE_MALLOC typedef __mem_interface alloc; typedef __mem_interface single_client_alloc; # else >Release-Note: >Audit-Trail: >Unformatted: