Skip to content

Commit

Permalink
#i124896# remove obsoleted sal-module-internal custom STL allocator
Browse files Browse the repository at this point in the history
The SAL module avoided the heavy dependency on the stlport4-libraries by using
a custom allocator for its internal STL containers. With stlport4 removed these
dependencies are gone and the SAL-internal custom allocator is obsoleted. Since
the custom allocator results in build problems with clang>=3.4 or xcode>=5.1 it
is time to remove it for good.


git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1594842 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
hdu-hh committed May 15, 2014
1 parent 020bbb1 commit 22076bf
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 220 deletions.
14 changes: 1 addition & 13 deletions main/sal/inc/osl/diagnose.hxx
Expand Up @@ -23,21 +23,10 @@
#if ! defined(OSL_DIAGNOSE_HXX_INCLUDED)
#define OSL_DIAGNOSE_HXX_INCLUDED

#if ! defined(_OSL_DIAGNOSE_H_)
#include "osl/diagnose.h"
#endif
#if ! defined(_OSL_INTERLOCK_H_)
#include "osl/interlck.h"
#endif
#if ! defined(_OSL_MUTEX_HXX_)
#include "osl/mutex.hxx"
#endif
#if ! defined(INCLUDED_RTL_ALLOCATOR_HXX)
#include "rtl/allocator.hxx"
#endif
#if ! defined(_RTL_INSTANCE_HXX_)
#include "rtl/instance.hxx"
#endif
#include <hash_set>
#include <functional>
#include <typeinfo>
Expand Down Expand Up @@ -91,8 +80,7 @@ struct VoidPtrHash : ::std::unary_function<void const*, ::std::size_t> {
}
};

typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
::rtl::Allocator<void const*> > VoidPointerSet;
typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*> > VoidPointerSet;

struct ObjectRegistryData {
ObjectRegistryData( ::std::type_info const& rTypeInfo )
Expand Down
171 changes: 0 additions & 171 deletions main/sal/inc/rtl/allocator.hxx

This file was deleted.

2 changes: 1 addition & 1 deletion main/sal/osl/all/debugbase.cxx
Expand Up @@ -44,7 +44,7 @@

namespace {

typedef std::vector<rtl::OString, rtl::Allocator<rtl::OString> > OStringVec;
typedef std::vector<rtl::OString> OStringVec;

struct StaticDebugBaseAddressFilter
: rtl::StaticWithInit<OStringVec const, StaticDebugBaseAddressFilter> {
Expand Down
1 change: 0 additions & 1 deletion main/sal/osl/w32/path_helper.hxx
Expand Up @@ -30,7 +30,6 @@

#include "path_helper.h"
#include <rtl/ustring.hxx>
#include <rtl/allocator.hxx>

namespace osl
{
Expand Down
10 changes: 4 additions & 6 deletions main/sal/osl/w32/procimpl.cxx
Expand Up @@ -43,7 +43,6 @@
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include "secimpl.h"
#include "rtl/allocator.hxx"
#include <osl/file.hxx>

#include <list>
Expand All @@ -63,11 +62,11 @@ const rtl::OUString QUOTE = rtl::OUString::createFromAscii("\"");
namespace /* private */
{
//#################################################
typedef std::list<rtl::OUString, rtl::Allocator<rtl::OUString> > string_container_t;
typedef std::list<rtl::OUString> string_container_t;
typedef string_container_t::iterator string_container_iterator_t;
typedef string_container_t::const_iterator string_container_const_iterator_t;
typedef std::pair<string_container_iterator_t, string_container_iterator_t> iterator_pair_t;
typedef std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > environment_container_t;
typedef std::vector<sal_Unicode > environment_container_t;

//#################################################
/* Function object that compares two strings that are
Expand Down Expand Up @@ -307,7 +306,7 @@ namespace /* private */
rtl::OUString ret(path);
if (path.getLength() > 260)
{
std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec(path.getLength() + 1);
std::vector<sal_Unicode> vec(path.getLength() + 1);
//GetShortPathNameW only works if the file can be found!
const DWORD len = GetShortPathNameW(
reinterpret_cast<LPCWSTR>(path.getStr()), reinterpret_cast<LPWSTR>(&vec[0]), path.getLength() + 1);
Expand All @@ -316,8 +315,7 @@ namespace /* private */
&& extension.getLength())
{
const rtl::OUString extPath(path + extension);
std::vector<sal_Unicode, rtl::Allocator<sal_Unicode> > vec2(
extPath.getLength() + 1);
std::vector<sal_Unicode > vec2( extPath.getLength() + 1);
const DWORD len2 = GetShortPathNameW(
reinterpret_cast<LPCWSTR>(extPath.getStr()), reinterpret_cast<LPWSTR>(&vec2[0]), extPath.getLength() + 1);
ret = rtl::OUString(&vec2[0], len2);
Expand Down
4 changes: 1 addition & 3 deletions main/sal/qa/osl/process/osl_process.cxx
Expand Up @@ -44,8 +44,6 @@
#include <tools/postwin.h>
#endif

#include "rtl/allocator.hxx"

#include <iostream>
#include <fstream>
#include <vector>
Expand Down Expand Up @@ -296,7 +294,7 @@ class Test_osl_joinProcess : public CppUnit::TestFixture

//#########################################################

typedef std::vector<std::string, rtl::Allocator<std::string> > string_container_t;
typedef std::vector<std::string> string_container_t;
typedef string_container_t::const_iterator string_container_const_iter_t;
typedef string_container_t::iterator string_container_iter_t;

Expand Down
11 changes: 2 additions & 9 deletions main/sal/rtl/source/bootstrap.cxx
Expand Up @@ -41,7 +41,6 @@
#include <rtl/instance.hxx>
#include <rtl/malformeduriexception.hxx>
#include <rtl/uri.hxx>
#include "rtl/allocator.hxx"

#include "macro.hxx"

Expand Down Expand Up @@ -134,10 +133,7 @@ struct rtl_bootstrap_NameValue
{}
};

typedef std::list<
rtl_bootstrap_NameValue,
rtl::Allocator< rtl_bootstrap_NameValue >
> NameValueList;
typedef std::list<rtl_bootstrap_NameValue> NameValueList;

bool find(
NameValueList const & list, rtl::OUString const & key,
Expand Down Expand Up @@ -605,10 +601,7 @@ void Bootstrap_Impl::expandValue(
namespace {

struct bootstrap_map {
typedef std::hash_map<
rtl::OUString, Bootstrap_Impl *,
rtl::OUStringHash, std::equal_to< rtl::OUString >,
rtl::Allocator< OUString > > t;
typedef std::hash_map< const rtl::OUString, Bootstrap_Impl*, rtl::OUStringHash > t;

// get and release must only be called properly synchronized via some mutex
// (e.g., osl::Mutex::getGlobalMutex()):
Expand Down
5 changes: 1 addition & 4 deletions main/sal/rtl/source/hash.cxx
Expand Up @@ -23,12 +23,10 @@

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
#include "rtl/allocator.hxx"

#include "hash.h"
#include "strimp.h"


#include <hash_set>

namespace {
Expand All @@ -53,8 +51,7 @@ struct UStringEqual
}
};

typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual,
rtl::Allocator<rtl_uString *> > StringHashTable;
typedef std::hash_set< rtl_uString *, UStringHash, UStringEqual > StringHashTable;

StringHashTable *
getHashTable ()
Expand Down
18 changes: 6 additions & 12 deletions main/sal/rtl/source/unload.cxx
Expand Up @@ -28,7 +28,6 @@
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
#include <hash_map>
#include "rtl/allocator.hxx"

#include <functional>
#include <list>
Expand Down Expand Up @@ -153,11 +152,10 @@ struct hashModule
};

typedef std::hash_map<
oslModule,
const oslModule,
std::pair<sal_uInt32, component_canUnloadFunc>,
hashModule,
std::equal_to<oslModule>,
rtl::Allocator<oslModule>
std::equal_to<oslModule>
> ModuleMap;

typedef ModuleMap::iterator Mod_IT;
Expand Down Expand Up @@ -243,7 +241,7 @@ extern "C" void SAL_CALL rtl_unloadUnusedModules( TimeValue* libUnused)
{
MutexGuard guard( getUnloadingMutex());

typedef std::list< oslModule, rtl::Allocator<oslModule> > list_type;
typedef std::list< oslModule > list_type;
list_type unloadedModulesList;

ModuleMap& moduleMap= getModuleMap();
Expand Down Expand Up @@ -302,11 +300,10 @@ struct hashListener
};

typedef std::hash_map<
sal_Int32,
const sal_Int32,
std::pair<rtl_unloadingListenerFunc, void*>,
hashListener,
std::equal_to<sal_Int32>,
rtl::Allocator<sal_Int32>
std::equal_to<sal_Int32>
> ListenerMap;

typedef ListenerMap::iterator Lis_IT;
Expand All @@ -333,10 +330,7 @@ static ListenerMap& getListenerMap()
// available. Otherwise a new cookie will be provided.
// not a new value is returned.

typedef std::deque<
sal_Int32,
rtl::Allocator<sal_Int32>
> queue_type;
typedef std::deque< sal_Int32 > queue_type;

static queue_type& getCookieQueue()
{
Expand Down

0 comments on commit 22076bf

Please sign in to comment.