diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2004-03-13 06:54:25 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2004-03-13 06:54:25 +0000 |
commit | 8b0d605196ebf4556ef13b3a5a62d69f20ed2e36 (patch) | |
tree | 61365023920e49ff4fc09d8899c129b6beac5a51 | |
parent | 992ab1225db9e73dc4a793b9d4831967a51250f9 (diff) | |
download | gcc-8b0d605196ebf4556ef13b3a5a62d69f20ed2e36.zip gcc-8b0d605196ebf4556ef13b3a5a62d69f20ed2e36.tar.gz gcc-8b0d605196ebf4556ef13b3a5a62d69f20ed2e36.tar.bz2 |
allocator: New.
2004-03-13 Benjamin Kosnik <bkoz@redhat.com>
* config/allocator: New.
* config/allocator/bitmap_allocator_base.h: New.
* config/allocator/malloc_allocator_base.h: New.
* config/allocator/mt_allocator_base.h: New.
* config/allocator/new_allocator_base.h: New.
* include/bits/allocator.h: Include c++allocator.h.
* acinclude.m4 (GLIBCXX_ENABLE_ALLOCATOR): New.
* aclocal.m4: Regenerate.
* configure.ac: Use GLIBCXX_ENABLE_ALLOCATOR.
* configure: Regenerate.
* include/Makefile.am (host_headers_extra): Add c++allocator.h.
* include/Makefile.in: Regenerate.
* docs/html/configopts.html: Add enable-libstdcxx-allocator.
From-SVN: r79435
-rw-r--r-- | libstdc++-v3/ChangeLog | 16 | ||||
-rw-r--r-- | libstdc++-v3/Makefile.in | 2 | ||||
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 73 | ||||
-rw-r--r-- | libstdc++-v3/config/allocator/bitmap_allocator_base.h | 37 | ||||
-rw-r--r-- | libstdc++-v3/config/allocator/malloc_allocator_base.h | 37 | ||||
-rw-r--r-- | libstdc++-v3/config/allocator/mt_allocator_base.h | 37 | ||||
-rw-r--r-- | libstdc++-v3/config/allocator/new_allocator_base.h | 37 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 90 | ||||
-rw-r--r-- | libstdc++-v3/configure.ac | 1 | ||||
-rw-r--r-- | libstdc++-v3/docs/html/configopts.html | 17 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.am | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.in | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/allocator.h | 13 | ||||
-rw-r--r-- | libstdc++-v3/libmath/Makefile.in | 2 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/Makefile.in | 2 | ||||
-rw-r--r-- | libstdc++-v3/po/Makefile.in | 2 | ||||
-rw-r--r-- | libstdc++-v3/src/Makefile.in | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/Makefile.in | 2 |
18 files changed, 364 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 816846c..022a726 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2004-03-13 Benjamin Kosnik <bkoz@redhat.com> + + * config/allocator: New. + * config/allocator/bitmap_allocator_base.h: New. + * config/allocator/malloc_allocator_base.h: New. + * config/allocator/mt_allocator_base.h: New. + * config/allocator/new_allocator_base.h: New. + * include/bits/allocator.h: Include c++allocator.h. + * acinclude.m4 (GLIBCXX_ENABLE_ALLOCATOR): New. + * aclocal.m4: Regenerate. + * configure.ac: Use GLIBCXX_ENABLE_ALLOCATOR. + * configure: Regenerate. + * include/Makefile.am (host_headers_extra): Add c++allocator.h. + * include/Makefile.in: Regenerate. + * docs/html/configopts.html: Add enable-libstdcxx-allocator. + 2004-03-12 Benjamin Kosnik <bkoz@redhat.com> * include/bits/allocator.h: Revert. diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 3e2c646..0e7a5f5 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -87,6 +87,8 @@ GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 3c621ab..e9ba13f 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1171,6 +1171,79 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ dnl +dnl Check for which std::allocator base class to use. The choice is +dnl mapped from a subdirectory of include/ext. +dnl +dnl Default is new. +dnl +AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [ + AC_MSG_CHECKING([for std::allocator base class to use]) + GLIBCXX_ENABLE(libstdcxx-allocator,auto,[=KIND], + [use KIND for target std::allocator base], + [permit new|malloc|mt|bitmap|yes|no|auto]) + # If they didn't use this option switch, or if they specified --enable + # with no specific model, we'll have to look for one. If they + # specified --disable (???), do likewise. + if test $enable_libstdcxx_allocator = no || test $enable_libstdcxx_allocator = yes; then + enable_libstdcxx_allocator=auto + fi + + # Either a known package, or "auto" + enable_libstdcxx_allocator_flag=$enable_libstdcxx_allocator + + # Probe for host-specific support if no specific model is specified. + # Default to "new". + if test $enable_libstdcxx_allocator_flag = auto; then + case ${target_os} in + freebsd*) + enable_libstdcxx_allocator_flag=mt + ;; + hpux11*) + enable_libstdcxx_allocator_flag=mt + ;; + irix6*) + enable_libstdcxx_allocator_flag=mt + ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_libstdcxx_allocator_flag=mt + ;; + solaris*) + enable_libstdcxx_allocator_flag=mt + ;; + *) + enable_libstdcxx_allocator_flag=new + ;; + esac + fi + AC_MSG_RESULT($enable_libstdcxx_allocator_flag) + + + # Set configure bits for specified locale package + case ${enable_libstdcxx_allocator_flag} in + bitmap) + ALLOCATOR_H=config/allocator/bitmap_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::bitmap_allocator + ;; + malloc) + ALLOCATOR_H=config/allocator/malloc_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::malloc_allocator + ;; + mt) + ALLOCATOR_H=config/allocator/mt_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::__mt_alloc + ;; + new) + ALLOCATOR_H=config/allocator/new_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::new_allocator + ;; + esac + + AC_SUBST(ALLOCATOR_H) + AC_SUBST(ALLOCATOR_NAME) +]) + + +dnl dnl Check for whether the Boost-derived checks should be turned on. dnl dnl --enable-concept-checks turns them on. diff --git a/libstdc++-v3/config/allocator/bitmap_allocator_base.h b/libstdc++-v3/config/allocator/bitmap_allocator_base.h new file mode 100644 index 0000000..bf84ae0 --- /dev/null +++ b/libstdc++-v3/config/allocator/bitmap_allocator_base.h @@ -0,0 +1,37 @@ +// Base to std::allocator -*- C++ -*- + +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _CXX_ALLOCATOR_H +#define _CXX_ALLOCATOR_H 1 + +// Define bitmap_allocator as the base class to std::allocator. +#include <ext/bitmap_allocator.h> +#define ___glibcxx_base_allocator __gnu_cxx::bitmap_allocator + +#endif diff --git a/libstdc++-v3/config/allocator/malloc_allocator_base.h b/libstdc++-v3/config/allocator/malloc_allocator_base.h new file mode 100644 index 0000000..4a82ec3 --- /dev/null +++ b/libstdc++-v3/config/allocator/malloc_allocator_base.h @@ -0,0 +1,37 @@ +// Base to std::allocator -*- C++ -*- + +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _CXX_ALLOCATOR_H +#define _CXX_ALLOCATOR_H 1 + +// Define new_allocator as the base class to std::allocator. +#include <ext/malloc_allocator.h> +#define ___glibcxx_base_allocator __gnu_cxx::malloc_allocator + +#endif diff --git a/libstdc++-v3/config/allocator/mt_allocator_base.h b/libstdc++-v3/config/allocator/mt_allocator_base.h new file mode 100644 index 0000000..52b4421 --- /dev/null +++ b/libstdc++-v3/config/allocator/mt_allocator_base.h @@ -0,0 +1,37 @@ +// Base to std::allocator -*- C++ -*- + +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _CXX_ALLOCATOR_H +#define _CXX_ALLOCATOR_H 1 + +// Define mt_allocator as the base class to std::allocator. +#include <ext/mt_allocator.h> +#define ___glibcxx_base_allocator __gnu_cxx::__mt_alloc + +#endif diff --git a/libstdc++-v3/config/allocator/new_allocator_base.h b/libstdc++-v3/config/allocator/new_allocator_base.h new file mode 100644 index 0000000..442f89c --- /dev/null +++ b/libstdc++-v3/config/allocator/new_allocator_base.h @@ -0,0 +1,37 @@ +// Base to std::allocator -*- C++ -*- + +// Copyright (C) 2004 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _CXX_ALLOCATOR_H +#define _CXX_ALLOCATOR_H 1 + +// Define new_allocator as the base class to std::allocator. +#include <ext/new_allocator.h> +#define ___glibcxx_base_allocator __gnu_cxx::new_allocator + +#endif diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 0b2c97c..c82bf3f 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOL CXXCPP CPPFLAGS enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC CPP EGREP check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CCODECVT_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE glibcxx_thread_h DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE EXTRA_CXX_FLAGS WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS SYMVER_MAP port_specific_symbol_files GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE baseline_dir GLIBCXX_TEST_WCHAR_T_TRUE GLIBCXX_TEST_WCHAR_T_FALSE GLIBCXX_TEST_ABI_TRUE GLIBCXX_TEST_ABI_FALSE ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR OS_INC_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOL CXXCPP CPPFLAGS enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC CPP EGREP check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CCODECVT_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H ALLOCATOR_H ALLOCATOR_NAME C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE glibcxx_thread_h DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE EXTRA_CXX_FLAGS WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS SYMVER_MAP port_specific_symbol_files GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE baseline_dir GLIBCXX_TEST_WCHAR_T_TRUE GLIBCXX_TEST_WCHAR_T_FALSE GLIBCXX_TEST_ABI_TRUE GLIBCXX_TEST_ABI_FALSE ATOMICITY_SRCDIR ATOMIC_WORD_SRCDIR OS_INC_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -864,6 +864,9 @@ Optional Features: use MODEL for target locale package [default=auto] --enable-nls use Native Language Support (default) + --enable-libstdcxx-allocator=KIND + use KIND for target std::allocator base + [default=auto] --enable-cheaders=KIND construct "C" headers for g++ [default=$c_model] --enable-c-mbchar enable multibyte (wide) characters @@ -4422,7 +4425,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4425 "configure"' > conftest.$ac_ext + echo '#line 4428 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5036,7 +5039,7 @@ fi; # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 5039 "configure" +#line 5042 "configure" struct S { ~S(); }; void bar(); void foo() @@ -6257,6 +6260,85 @@ _ACEOF + echo "$as_me:$LINENO: checking for std::allocator base class to use" >&5 +echo $ECHO_N "checking for std::allocator base class to use... $ECHO_C" >&6 + # Check whether --enable-libstdcxx-allocator or --disable-libstdcxx-allocator was given. +if test "${enable_libstdcxx_allocator+set}" = set; then + enableval="$enable_libstdcxx_allocator" + + case "$enableval" in + new|malloc|mt|bitmap|yes|no|auto) ;; + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable libstdcxx-allocator" >&5 +echo "$as_me: error: Unknown argument to enable/disable libstdcxx-allocator" >&2;} + { (exit 1); exit 1; }; } ;; + esac + +else + enable_libstdcxx_allocator=auto +fi; + + # If they didn't use this option switch, or if they specified --enable + # with no specific model, we'll have to look for one. If they + # specified --disable (???), do likewise. + if test $enable_libstdcxx_allocator = no || test $enable_libstdcxx_allocator = yes; then + enable_libstdcxx_allocator=auto + fi + + # Either a known package, or "auto" + enable_libstdcxx_allocator_flag=$enable_libstdcxx_allocator + + # Probe for host-specific support if no specific model is specified. + # Default to "new". + if test $enable_libstdcxx_allocator_flag = auto; then + case ${target_os} in + freebsd*) + enable_libstdcxx_allocator_flag=mt + ;; + hpux11*) + enable_libstdcxx_allocator_flag=mt + ;; + irix6*) + enable_libstdcxx_allocator_flag=mt + ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_libstdcxx_allocator_flag=mt + ;; + solaris*) + enable_libstdcxx_allocator_flag=mt + ;; + *) + enable_libstdcxx_allocator_flag=new + ;; + esac + fi + echo "$as_me:$LINENO: result: $enable_libstdcxx_allocator_flag" >&5 +echo "${ECHO_T}$enable_libstdcxx_allocator_flag" >&6 + + + # Set configure bits for specified locale package + case ${enable_libstdcxx_allocator_flag} in + bitmap) + ALLOCATOR_H=config/allocator/bitmap_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::bitmap_allocator + ;; + malloc) + ALLOCATOR_H=config/allocator/malloc_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::malloc_allocator + ;; + mt) + ALLOCATOR_H=config/allocator/mt_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::__mt_alloc + ;; + new) + ALLOCATOR_H=config/allocator/new_allocator_base.h + ALLOCATOR_NAME=__gnu_cxx::new_allocator + ;; + esac + + + + + # Check whether --enable-cheaders or --disable-cheaders was given. if test "${enable_cheaders+set}" = set; then enableval="$enable_cheaders" @@ -73754,6 +73836,8 @@ s,@CTIME_H@,$CTIME_H,;t t s,@CTIME_CC@,$CTIME_CC,;t t s,@CLOCALE_CC@,$CLOCALE_CC,;t t s,@CLOCALE_INTERNAL_H@,$CLOCALE_INTERNAL_H,;t t +s,@ALLOCATOR_H@,$ALLOCATOR_H,;t t +s,@ALLOCATOR_NAME@,$ALLOCATOR_NAME,;t t s,@C_INCLUDE_DIR@,$C_INCLUDE_DIR,;t t s,@GLIBCXX_C_HEADERS_C_TRUE@,$GLIBCXX_C_HEADERS_C_TRUE,;t t s,@GLIBCXX_C_HEADERS_C_FALSE@,$GLIBCXX_C_HEADERS_C_FALSE,;t t diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index d7ab49d..a7533f8 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -84,6 +84,7 @@ GLIBCXX_ENABLE_PCH($is_hosted) # NB: C_MBCHAR must come early. GLIBCXX_ENABLE_CSTDIO GLIBCXX_ENABLE_CLOCALE +GLIBCXX_ENABLE_ALLOCATOR GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host GLIBCXX_ENABLE_C_MBCHAR([yes]) GLIBCXX_ENABLE_C99([yes]) diff --git a/libstdc++-v3/docs/html/configopts.html b/libstdc++-v3/docs/html/configopts.html index 17ccaf9..6a2e214 100644 --- a/libstdc++-v3/docs/html/configopts.html +++ b/libstdc++-v3/docs/html/configopts.html @@ -124,6 +124,23 @@ options</a></h1> </p> </dd> + <dt><code>--enable-libstdcxx-allocator </code></dt> + <dd><p>This is an abbreviated form of + <code>'--enable-libstdcxx-allocator=auto'</code> (described + next). This option can change the library ABI. + </p> + </dd> + + <dt><code>--enable-libstdcxx-allocator=OPTION </code></dt> + <dd><p>Select a target-specific underlying std::allocator. The + choices are 'new' to specify a wrapper for new, 'malloc' to + specify a wrapper for malloc, 'mt' for a fixed power of two allocator + (More <a href="http://sources.redhat.com/glibc/">info</a>) or + 'bitmap' for a bitmap allocator. This option can change the + library ABI. + </p> + </dd> + <dt><code>--enable-cheaders=OPTION </code></dt> <dd><p>This allows the user to define what kind of C headers are used. Options are: c, c_std, and c_shadow. These correspond diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index df51997..34e2033 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -351,6 +351,7 @@ host_headers_noinst = \ host_headers_extra = \ ${host_builddir}/basic_file.h \ ${host_builddir}/c++config.h \ + ${host_builddir}/c++allocator.h \ ${host_builddir}/c++io.h \ ${host_builddir}/c++locale.h \ ${host_builddir}/messages_members.h \ @@ -480,6 +481,7 @@ stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias} (cd ${host_builddir} ;\ $(LN_S) ${host_headers} . || true ;\ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\ + $(LN_S) ${glibcxx_srcdir}/$(ALLOCATOR_H) c++allocator.h || true ;\ $(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_H) c++locale.h || true ;\ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H) . || true ;\ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 69dfe30..b22acf2 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -55,6 +55,8 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ @@ -559,6 +561,7 @@ host_headers_noinst = \ host_headers_extra = \ ${host_builddir}/basic_file.h \ ${host_builddir}/c++config.h \ + ${host_builddir}/c++allocator.h \ ${host_builddir}/c++io.h \ ${host_builddir}/c++locale.h \ ${host_builddir}/messages_members.h \ @@ -854,6 +857,7 @@ stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias} (cd ${host_builddir} ;\ $(LN_S) ${host_headers} . || true ;\ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\ + $(LN_S) ${glibcxx_srcdir}/$(ALLOCATOR_H) c++allocator.h || true ;\ $(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_H) c++locale.h || true ;\ $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H) . || true ;\ diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h index eca50c8..c9200ec 100644 --- a/libstdc++-v3/include/bits/allocator.h +++ b/libstdc++-v3/include/bits/allocator.h @@ -49,12 +49,7 @@ #define _ALLOCATOR_H 1 // Define the base class to std::allocator. - -#include <ext/new_allocator.h> -#define __glibcxx_default_allocator __gnu_cxx::new_allocator - -//#include <ext/mt_allocator.h> -//#define __glibcxx_default_allocator __gnu_cxx::__mt_alloc +#include <bits/c++allocator.h> namespace std { @@ -82,7 +77,7 @@ namespace std * (See @link Allocators allocators info @endlink for more.) */ template<typename _Tp> - class allocator: public __glibcxx_default_allocator<_Tp> + class allocator: public ___glibcxx_base_allocator<_Tp> { public: typedef size_t size_type; @@ -100,7 +95,7 @@ namespace std allocator() throw() { } allocator(const allocator& a) throw() - : __glibcxx_default_allocator<_Tp>(a) { } + : ___glibcxx_base_allocator<_Tp>(a) { } template<typename _Tp1> allocator(const allocator<_Tp1>&) throw() { } @@ -129,7 +124,7 @@ namespace std #endif // Undefine. -#undef __glibcxx_default_allocator +#undef ___glibcxx_base_allocator } // namespace std #endif diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in index 1394be4..279443d 100644 --- a/libstdc++-v3/libmath/Makefile.in +++ b/libstdc++-v3/libmath/Makefile.in @@ -72,6 +72,8 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index ba70e6d..95a4be3 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -90,6 +90,8 @@ ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index cfba694..e009066 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -55,6 +55,8 @@ SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index a24cb79..fccb39e 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -83,6 +83,8 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) VPATH = $(top_srcdir)/src:$(top_srcdir) ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 57e52d2..78c6b7c 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -84,6 +84,8 @@ EXPECT = expect RUNTEST = runtest DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ +ALLOCATOR_H = @ALLOCATOR_H@ +ALLOCATOR_NAME = @ALLOCATOR_NAME@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ |