LEAK_STATIC_DATA is always defined for WNT

cppu_no_leak and bndchk were remnants from pre-gbuild times

Change-Id: Ie9f325c20e39c100b4a7180a9925559f58bcca6b
Reviewed-on: https://gerrit.libreoffice.org/34153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2017-02-11 18:41:40 +01:00
parent 6d15d4a6f6
commit c26d6edbc1
3 changed files with 0 additions and 89 deletions

View File

@@ -195,13 +195,6 @@ $(eval $(call gb_Library_add_defs,$(gb_CPPU_ENV)_uno,\
-DHAVE_POSIX_FALLOCATE \
))
endif
ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_defs,$(gb_CPPU_ENV)_uno,\
$(if $(cppu_no_leak)$(bndchk),,\
-DLEAK_STATIC_DATA \
) \
))
endif
# In case someone enabled the non-standard -fomit-frame-pointer which does not
# work with the .cxx sources of this library.

View File

@@ -391,12 +391,7 @@ void * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTypeDescr ) thro
MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pInfos)
{
#ifdef LEAK_STATIC_DATA
s_pInfos = new ExceptionInfos();
#else
static ExceptionInfos s_allExceptionInfos;
s_pInfos = &s_allExceptionInfos;
#endif
}
}
@@ -439,12 +434,7 @@ type_info * msci_getRTTI( OUString const & rUNOname )
MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pRTTIs)
{
#ifdef LEAK_STATIC_DATA
s_pRTTIs = new RTTInfos();
#else
static RTTInfos s_aRTTIs;
s_pRTTIs = &s_aRTTIs;
#endif
}
}
return s_pRTTIs->getRTTI( rUNOname );

View File

@@ -320,9 +320,6 @@ public:
type_info_descriptor * insert_new_type_info_descriptor(OUString const & rUNOname);
RTTInfos() throw ();
#if !defined LEAK_STATIC_DATA
~RTTInfos() throw ();
#endif
};
class type_info_
{
@@ -429,22 +426,6 @@ RTTInfos::RTTInfos() throw ()
{
}
#if !defined LEAK_STATIC_DATA
RTTInfos::~RTTInfos() throw ()
{
SAL_INFO("bridges", "> freeing generated RTTI infos... <");
MutexGuard aGuard( _aMutex );
for ( t_string2PtrMap::const_iterator iPos( _allRTTI.begin() );
iPos != _allRTTI.end(); ++iPos )
{
type_info_ * pType = static_cast<type_info_ *>(iPos->second);
pType->~type_info_(); // obsolete, but good style...
::rtl_freeMemory( pType );
}
}
#endif
void * __cdecl copyConstruct(
void * pExcThis,
void * pSource,
@@ -556,9 +537,6 @@ public:
static DWORD allocationGranularity;
ExceptionInfos() throw ();
#if !defined LEAK_STATIC_DATA
~ExceptionInfos() throw ();
#endif
};
DWORD ExceptionInfos::allocationGranularity = 0;
@@ -578,10 +556,6 @@ struct RaiseInfo
sal_uInt64 _codeBase;
explicit RaiseInfo(typelib_TypeDescription * pTD) throw ();
#if !defined LEAK_STATIC_DATA
~RaiseInfo() throw ();
#endif
};
/* Rewrite of 32-Bit-Code to work under 64 Bit:
@@ -702,41 +676,10 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
assert(etMem + etMemOffset == pCode + totalSize);
}
#if !defined LEAK_STATIC_DATA
RaiseInfo::~RaiseInfo() throw ()
{
sal_uInt32 * pTypes = reinterpret_cast<sal_uInt32 *>(_codeBase + _types) + 1;
// Because of placement new we have to call D.-tor, not delete!
for ( int nTypes = *reinterpret_cast<sal_uInt32 *>(_codeBase + _types); nTypes--; )
{
ExceptionType *et = reinterpret_cast<ExceptionType *>(_codeBase + pTypes[nTypes]);
et->~ExceptionType();
}
// free our single block
::rtl_freeMemory( _code );
::typelib_typedescription_release( _pTD );
}
#endif
ExceptionInfos::ExceptionInfos() throw ()
{
}
#if !defined LEAK_STATIC_DATA
ExceptionInfos::~ExceptionInfos() throw ()
{
SAL_INFO("bridges", "> freeing exception infos... <");
MutexGuard aGuard( _aMutex );
for ( t_string2PtrMap::const_iterator iPos( _allRaiseInfos.begin() );
iPos != _allRaiseInfos.end(); ++iPos )
{
delete static_cast<RaiseInfo *>(iPos->second);
}
}
#endif
RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw ()
{
static ExceptionInfos * s_pInfos = nullptr;
@@ -749,12 +692,7 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw
GetSystemInfo( &systemInfo );
allocationGranularity = systemInfo.dwAllocationGranularity;
#ifdef LEAK_STATIC_DATA
s_pInfos = new ExceptionInfos();
#else
static ExceptionInfos s_allExceptionInfos;
s_pInfos = &s_allExceptionInfos;
#endif
}
}
@@ -795,12 +733,7 @@ type_info * mscx_getRTTI(
MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pRTTIs)
{
#ifdef LEAK_STATIC_DATA
s_pRTTIs = new RTTInfos();
#else
static RTTInfos s_aRTTIs;
s_pRTTIs = &s_aRTTIs;
#endif
}
}
return s_pRTTIs->getRTTI( rUNOname );
@@ -814,12 +747,7 @@ int mscx_getRTTI_len(
MutexGuard aGuard(Mutex::getGlobalMutex());
if (!s_pRTTIs)
{
#ifdef LEAK_STATIC_DATA
s_pRTTIs = new RTTInfos();
#else
static RTTInfos s_aRTTIs;
s_pRTTIs = &s_aRTTIs;
#endif
}
}
return s_pRTTIs->getRTTI_len(rUNOname);