This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/8708: __USE_MALLOC doesn't work
- From: bkoz at nabi dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Nov 2002 05:12:28 -0000
- Subject: libstdc++/8708: __USE_MALLOC doesn't work
- Reply-to: bkoz at nabi dot net
>Number: 8708
>Category: libstdc++
>Synopsis: __USE_MALLOC doesn't work
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Nov 25 21:16:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: bkoz@nabi.net
>Release: gcc-3.2.1 on x86/linux
>Organization:
>Environment:
RH 8
>Description:
Cannot __USE_MALLOC to get a malloc allocator.This is a regression from 2.95 and 2.96 based compilers.
This is fixed in mainline with the use of GLIBCPP_FORCE_NEW.
2002-10-18 Loren J. Rittle <ljrittle@acm.org>
Brad Spencer <spencer@infointeractive.com>
(provided alternate patch and improvements)
* docs/html/23_containers/howto.html (GLIBCPP_FORCE_NEW): Document
new environment variable which replaces all uses of __USE_MALLOC
macro.
* docs/html/ext/howto.html (GLIBCPP_FORCE_NEW): Likewise.
(__mem_interface): Remove all references to old internal typedef.
* include/backward/alloc.h (__USE_MALLOC): Remove it and all
guarded code.
* include/bits/c++config (__USE_MALLOC): Update related error
message and comment.
* include/bits/stl_alloc.h (__USE_MALLOC): Remove it and all
guarded code. Update all related comments.
(__mem_interface): Unconditionally replace it with __new_alloc.
However, leave the typedef around in case anyone used it.
(__default_alloc_template<>::_S_force_new): New class static.
(__default_alloc_template<>::allocate, deallocate): Add
run-time controlled feature similar to what __USE_MALLOC code
path had provided.
* src/stl-inst.cc (__USE_MALLOC): Remove it and all
guarded code.
* testsuite/21_strings/capacity.cc: Remove reference to __USE_MALLOC.
Add documentation on GLIBCPP_FORCE_NEW environment variable.
* testsuite/ext/allocators.cc: Likewise.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: