diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-24 16:32:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-27 08:47:38 +0200 |
commit | e6f4779de8fea16931967ce206439c5780d46125 (patch) | |
tree | dc898a89236247324e394815fe8bf821320c06c1 /sal/osl | |
parent | afd49c198769b5e7fc01a68ce7a6847aa0d0ddd8 (diff) |
directly use malloc/free in sal, instead of rtl_allocateMemory/etc
now that those functions are entirely malloc/free based, we can skip a
function call layer.
Change-Id: Ib091de0bdf4cdd58cee45185df17d96d3e8af402
Reviewed-on: https://gerrit.libreoffice.org/59576
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/file.cxx | 8 | ||||
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 10 | ||||
-rw-r--r-- | sal/osl/unx/profile.cxx | 8 | ||||
-rw-r--r-- | sal/osl/unx/socket.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/thread.cxx | 6 | ||||
-rw-r--r-- | sal/osl/w32/file.cxx | 8 | ||||
-rw-r--r-- | sal/osl/w32/file_dirvol.cxx | 34 | ||||
-rw-r--r-- | sal/osl/w32/file_url.cxx | 14 | ||||
-rw-r--r-- | sal/osl/w32/path_helper.hxx | 4 | ||||
-rw-r--r-- | sal/osl/w32/pipe.cxx | 10 | ||||
-rw-r--r-- | sal/osl/w32/process.cxx | 4 | ||||
-rw-r--r-- | sal/osl/w32/procimpl.cxx | 2 | ||||
-rw-r--r-- | sal/osl/w32/socket.cxx | 12 | ||||
-rw-r--r-- | sal/osl/w32/thread.cxx | 6 |
14 files changed, 64 insertions, 64 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index ae221a8834a6..910345d74f28 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -186,7 +186,7 @@ FileHandle_Impl::FileHandle_Impl(int fd, enum Kind kind, char const * path) if (pagesize != size_t(-1)) { m_bufsiz = pagesize; - m_buffer = static_cast<sal_uInt8 *>(rtl_allocateMemory(m_bufsiz)); + m_buffer = static_cast<sal_uInt8 *>(malloc(m_bufsiz)); if (m_buffer) memset(m_buffer, 0, m_bufsiz); } @@ -197,7 +197,7 @@ FileHandle_Impl::~FileHandle_Impl() { if (m_kind == KIND_FD) { - rtl_freeMemory(m_buffer); + free(m_buffer); m_buffer = nullptr; } @@ -208,12 +208,12 @@ FileHandle_Impl::~FileHandle_Impl() void* FileHandle_Impl::operator new (size_t n) { - return rtl_allocateMemory(n); + return malloc(n); } void FileHandle_Impl::operator delete (void * p) { - rtl_freeMemory(p); + free(p); } size_t FileHandle_Impl::getpagesize() diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 74712563311b..873bec3cb988 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -92,11 +92,11 @@ DirectoryItem_Impl::~DirectoryItem_Impl() void * DirectoryItem_Impl::operator new(size_t n) { - return rtl_allocateMemory(n); + return malloc(n); } void DirectoryItem_Impl::operator delete(void * p) { - rtl_freeMemory(p); + free(p); } void DirectoryItem_Impl::acquire() @@ -170,7 +170,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* ustrDirectoryURL, oslDirect if( pdir ) { - oslDirectoryImpl* pDirImpl = (oslDirectoryImpl*) rtl_allocateMemory( sizeof(oslDirectoryImpl) ); + oslDirectoryImpl* pDirImpl = (oslDirectoryImpl*) malloc( sizeof(oslDirectoryImpl) ); if( pDirImpl ) { @@ -197,7 +197,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* ustrDirectoryURL, oslDirect if( pdir ) { /* create and initialize impl structure */ - oslDirectoryImpl* pDirImpl = static_cast<oslDirectoryImpl*>(rtl_allocateMemory( sizeof(oslDirectoryImpl) )); + oslDirectoryImpl* pDirImpl = static_cast<oslDirectoryImpl*>(malloc( sizeof(oslDirectoryImpl) )); if( pDirImpl ) { @@ -251,7 +251,7 @@ oslFileError SAL_CALL osl_closeDirectory(oslDirectory pDirectory) /* cleanup members */ rtl_uString_release(pDirImpl->ustrPath); - rtl_freeMemory(pDirImpl); + free(pDirImpl); return err; } diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index d103c4573d0a..4bd77901b247 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -1068,7 +1068,7 @@ static sal_Char* OslProfile_getLine(osl_TFile* pFile) SAL_INFO("sal.osl", "read failed " << strerror(errno)); if( pLine ) - rtl_freeMemory( pLine ); + free( pLine ); pLine = nullptr; break; } @@ -1088,11 +1088,11 @@ static sal_Char* OslProfile_getLine(osl_TFile* pFile) pChr++); Max = pChr - pFile->m_pReadPtr; - pNewLine = static_cast<sal_Char*>(rtl_allocateMemory( nLineBytes + Max + 1 )); + pNewLine = static_cast<sal_Char*>(malloc( nLineBytes + Max + 1 )); if( pLine ) { memcpy( pNewLine, pLine, nLineBytes ); - rtl_freeMemory( pLine ); + free( pLine ); } memcpy(pNewLine+nLineBytes, pFile->m_pReadPtr, Max); nLineBytes += Max; @@ -1546,7 +1546,7 @@ static bool loadProfile(osl_TFile* pFile, osl_TProfileImpl* pProfile) while ( ( pLine=OslProfile_getLine(pFile) ) != nullptr ) { sal_Char* bWasAdded = addLine( pProfile, pLine ); - rtl_freeMemory( pLine ); + free( pLine ); SAL_WARN_IF(!bWasAdded, "sal.osl", "addLine( pProfile, pLine ) ==> false"); if ( ! bWasAdded ) return false; diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index c941f25658eb..edacf5f5e565 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -345,7 +345,7 @@ static oslSocketAddr createSocketAddrFromSystem( struct sockaddr *pSystemSockAdd static void destroySocketAddr( oslSocketAddr addr ) { - rtl_freeMemory( addr ); + free( addr ); } oslSocketAddr SAL_CALL osl_createEmptySocketAddr(oslAddrFamily Family) diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx index affbc5c3fb9c..1cac41ce717b 100644 --- a/sal/osl/unx/thread.cxx +++ b/sal/osl/unx/thread.cxx @@ -964,7 +964,7 @@ struct wrapper_pthread_key oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallback ) { - wrapper_pthread_key *pKey = static_cast<wrapper_pthread_key*>(rtl_allocateMemory(sizeof(wrapper_pthread_key))); + wrapper_pthread_key *pKey = static_cast<wrapper_pthread_key*>(malloc(sizeof(wrapper_pthread_key))); if (pKey) { @@ -972,7 +972,7 @@ oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallbac if (pthread_key_create(&(pKey->m_key), pKey->pfnCallback) != 0) { - rtl_freeMemory(pKey); + free(pKey); pKey = nullptr; } } @@ -986,7 +986,7 @@ void SAL_CALL osl_destroyThreadKey(oslThreadKey Key) if (pKey) { pthread_key_delete(pKey->m_key); - rtl_freeMemory(pKey); + free(pKey); } } diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index e92c5a584c31..78dfaa046939 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -153,26 +153,26 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile) m_buffer (nullptr) { ::InitializeCriticalSection (&m_mutex); - m_buffer = static_cast<sal_uInt8 *>(rtl_allocateMemory(m_bufsiz)); + m_buffer = static_cast<sal_uInt8 *>(malloc(m_bufsiz)); if (m_buffer) memset (m_buffer, 0, m_bufsiz); } FileHandle_Impl::~FileHandle_Impl() { - rtl_freeMemory(m_buffer); + free(m_buffer); m_buffer = nullptr; ::DeleteCriticalSection (&m_mutex); } void * FileHandle_Impl::operator new(size_t n) { - return rtl_allocateMemory(n); + return malloc(n); } void FileHandle_Impl::operator delete(void * p, size_t) { - rtl_freeMemory(p); + free(p); } SIZE_T FileHandle_Impl::getpagesize() diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index ef0f78491331..268c32a75dda 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -344,7 +344,7 @@ static HANDLE WINAPI OpenDirectory( rtl_uString* pPath) nSuffLen = 3; } - WCHAR* szFileMask = static_cast< WCHAR* >( rtl_allocateMemory( sizeof( WCHAR ) * ( nLen + nSuffLen + 1 ) ) ); + WCHAR* szFileMask = static_cast< WCHAR* >( malloc( sizeof( WCHAR ) * ( nLen + nSuffLen + 1 ) ) ); wcscpy( szFileMask, o3tl::toW(rtl_uString_getStr( pPath )) ); wcscat( szFileMask, pSuffix ); @@ -360,7 +360,7 @@ static HANDLE WINAPI OpenDirectory( rtl_uString* pPath) pDirectory = nullptr; } } - rtl_freeMemory(szFileMask); + free(szFileMask); } } @@ -436,7 +436,7 @@ static oslFileError osl_openLocalRoot( { Directory_Impl *pDirImpl; - pDirImpl = static_cast<Directory_Impl*>(rtl_allocateMemory( sizeof(Directory_Impl))); + pDirImpl = static_cast<Directory_Impl*>(malloc( sizeof(Directory_Impl))); ZeroMemory( pDirImpl, sizeof(Directory_Impl) ); rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strSysPath ); @@ -479,7 +479,7 @@ static oslFileError osl_openLocalRoot( pDirImpl->m_pDirectoryPath = nullptr; } - rtl_freeMemory(pDirImpl); + free(pDirImpl); pDirImpl = nullptr; } @@ -500,7 +500,7 @@ static oslFileError osl_openFileDirectory( return osl_File_E_INVAL; *pDirectory = nullptr; - Directory_Impl *pDirImpl = static_cast<Directory_Impl*>(rtl_allocateMemory(sizeof(Directory_Impl))); + Directory_Impl *pDirImpl = static_cast<Directory_Impl*>(malloc(sizeof(Directory_Impl))); ZeroMemory( pDirImpl, sizeof(Directory_Impl) ); rtl_uString_newFromString( &pDirImpl->m_pDirectoryPath, strDirectoryPath ); @@ -535,7 +535,7 @@ static oslFileError osl_openFileDirectory( pDirImpl->m_pDirectoryPath = nullptr; } - rtl_freeMemory(pDirImpl); + free(pDirImpl); pDirImpl = nullptr; } @@ -565,7 +565,7 @@ static oslFileError osl_openNetworkServer( { Directory_Impl *pDirImpl; - pDirImpl = static_cast<Directory_Impl*>(rtl_allocateMemory(sizeof(Directory_Impl))); + pDirImpl = static_cast<Directory_Impl*>(malloc(sizeof(Directory_Impl))); ZeroMemory( pDirImpl, sizeof(Directory_Impl) ); pDirImpl->uType = DIRECTORYTYPE_NETROOT; pDirImpl->hDirectory = hEnum; @@ -783,7 +783,7 @@ static oslFileError osl_getNextNetResource( case NO_ERROR: case ERROR_MORE_DATA: { - pItemImpl = static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + pItemImpl = static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) return osl_File_E_NOMEM; @@ -817,7 +817,7 @@ static oslFileError osl_getNextDrive( if ( !pDirImpl ) return osl_File_E_INVAL; - pItemImpl = static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + pItemImpl = static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) return osl_File_E_NOMEM; @@ -839,7 +839,7 @@ static oslFileError osl_getNextDrive( pItemImpl->m_pFullPath = nullptr; } - rtl_freeMemory( pItemImpl ); + free( pItemImpl ); return oslTranslateFileError( GetLastError() ); } } @@ -858,7 +858,7 @@ static oslFileError osl_getNextFileItem( if ( !pDirImpl ) return osl_File_E_INVAL; - pItemImpl = static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + pItemImpl = static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) return osl_File_E_NOMEM; @@ -887,7 +887,7 @@ static oslFileError osl_getNextFileItem( pItemImpl->m_pFullPath = nullptr; } - rtl_freeMemory( pItemImpl ); + free( pItemImpl ); return oslTranslateFileError( GetLastError() ); } } @@ -951,7 +951,7 @@ oslFileError SAL_CALL osl_closeDirectory(oslDirectory Directory) pDirImpl->m_pDirectoryPath = nullptr; } - rtl_freeMemory(pDirImpl); + free(pDirImpl); } return eError; } @@ -999,7 +999,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector case PATHTYPE_NETSERVER: { DirectoryItem_Impl* pItemImpl = - static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) error = osl_File_E_NOMEM; @@ -1030,7 +1030,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector case PATHTYPE_VOLUME: { DirectoryItem_Impl* pItemImpl = - static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); if ( !pItemImpl ) error = osl_File_E_NOMEM; @@ -1067,7 +1067,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString *strFilePath, oslDirector if ( hFind != INVALID_HANDLE_VALUE ) { DirectoryItem_Impl *pItemImpl = - static_cast<DirectoryItem_Impl*>(rtl_allocateMemory(sizeof(DirectoryItem_Impl))); + static_cast<DirectoryItem_Impl*>(malloc(sizeof(DirectoryItem_Impl))); ZeroMemory( pItemImpl, sizeof(DirectoryItem_Impl) ); osl_acquireDirectoryItem( static_cast<oslDirectoryItem>(pItemImpl) ); @@ -1120,7 +1120,7 @@ oslFileError SAL_CALL osl_releaseDirectoryItem( oslDirectoryItem Item ) pItemImpl->m_pFullPath = nullptr; } - rtl_freeMemory( pItemImpl ); + free( pItemImpl ); } return osl_File_E_None; diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 6cdb140aa22d..82260c85ef07 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -493,7 +493,7 @@ static bool osl_decodeURL_( rtl_String* strUTF8, rtl_uString** pstrDecodedURL ) /* The resulting decoded string length is shorter or equal to the source length */ nSrcLen = rtl_string_getLength(strUTF8); - pBuffer = static_cast<sal_Char*>(rtl_allocateMemory((nSrcLen + 1) * sizeof(sal_Char))); + pBuffer = static_cast<sal_Char*>(malloc((nSrcLen + 1) * sizeof(sal_Char))); pDest = pBuffer; pSrc = rtl_string_getStr(strUTF8); @@ -543,7 +543,7 @@ static bool osl_decodeURL_( rtl_String* strUTF8, rtl_uString** pstrDecodedURL ) OSL_ASSERT(*pstrDecodedURL != nullptr); } - rtl_freeMemory( pBuffer ); + free( pBuffer ); return bValidEncoded; } @@ -561,7 +561,7 @@ static void osl_encodeURL_( rtl_uString *strURL, rtl_String **pstrEncodedURL ) rtl_uString2String( &strUTF8, rtl_uString_getStr( strURL ), rtl_uString_getLength( strURL ), RTL_TEXTENCODING_UTF8, OUSTRING_TO_OSTRING_CVTFLAGS ); - pszEncodedURL = static_cast<sal_Char*>(rtl_allocateMemory( (rtl_string_getLength( strUTF8 ) * 3 + 1) * sizeof(sal_Char) )); + pszEncodedURL = static_cast<sal_Char*>(malloc( (rtl_string_getLength( strUTF8 ) * 3 + 1) * sizeof(sal_Char) )); pURLDest = pszEncodedURL; pURLScan = rtl_string_getStr( strUTF8 ); @@ -614,7 +614,7 @@ static void osl_encodeURL_( rtl_uString *strURL, rtl_String **pstrEncodedURL ) rtl_string_release( strUTF8 ); rtl_string_newFromStr( pstrEncodedURL, pszEncodedURL ); - rtl_freeMemory( pszEncodedURL ); + free( pszEncodedURL ); } oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **pustrPath, bool bAllowRelative ) @@ -903,8 +903,8 @@ oslFileError SAL_CALL osl_searchFileURL( /* +1 is not necessary if we follow MSDN documentation but for robustness we do so */ nBufferLength = dwResult + 1; lpBuffer = lpBuffer ? - static_cast<LPWSTR>(rtl_reallocateMemory(lpBuffer, nBufferLength * sizeof(WCHAR))) : - static_cast<LPWSTR>(rtl_allocateMemory(nBufferLength * sizeof(WCHAR))); + static_cast<LPWSTR>(realloc(lpBuffer, nBufferLength * sizeof(WCHAR))) : + static_cast<LPWSTR>(malloc(nBufferLength * sizeof(WCHAR))); dwResult = SearchPathW( lpszSearchPath, lpszSearchFile, nullptr, nBufferLength, lpBuffer, &lpszFilePart ); } while ( dwResult && dwResult >= nBufferLength ); @@ -934,7 +934,7 @@ oslFileError SAL_CALL osl_searchFileURL( } } - rtl_freeMemory( lpBuffer ); + free( lpBuffer ); } if ( ustrSysPath ) diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx index 0210791f401f..237c130f7fd8 100644 --- a/sal/osl/w32/path_helper.hxx +++ b/sal/osl/w32/path_helper.hxx @@ -93,7 +93,7 @@ class LongPathBuffer public: explicit LongPathBuffer( sal_uInt32 nCharNum ) - : m_pBuffer( static_cast<T*>( rtl_allocateMemory( nCharNum * sizeof( T ) ) ) ) + : m_pBuffer( static_cast<T*>( malloc( nCharNum * sizeof( T ) ) ) ) , m_nCharNum( nCharNum ) { OSL_ENSURE( m_pBuffer, "Can not allocate the buffer!" ); @@ -102,7 +102,7 @@ public: ~LongPathBuffer() { if ( m_pBuffer ) - rtl_freeMemory( m_pBuffer ); + free( m_pBuffer ); m_pBuffer = nullptr; } diff --git a/sal/osl/w32/pipe.cxx b/sal/osl/w32/pipe.cxx index 116bdd3d6817..92ec4f918354 100644 --- a/sal/osl/w32/pipe.cxx +++ b/sal/osl/w32/pipe.cxx @@ -87,8 +87,8 @@ void osl_destroyPipeImpl(oslPipe pPipe) if (pPipe->m_Security) { - rtl_freeMemory(pPipe->m_Security->lpSecurityDescriptor); - rtl_freeMemory(pPipe->m_Security); + free(pPipe->m_Security->lpSecurityDescriptor); + free(pPipe->m_Security); } CloseHandle(pPipe->m_ReadEvent); @@ -98,7 +98,7 @@ void osl_destroyPipeImpl(oslPipe pPipe) if (pPipe->m_Name) rtl_uString_release(pPipe->m_Name); - rtl_freeMemory(pPipe); + free(pPipe); } } @@ -135,13 +135,13 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options { PSECURITY_DESCRIPTOR pSecDesc; - pSecDesc = static_cast< PSECURITY_DESCRIPTOR >(rtl_allocateMemory(SECURITY_DESCRIPTOR_MIN_LENGTH)); + pSecDesc = static_cast< PSECURITY_DESCRIPTOR >(malloc(SECURITY_DESCRIPTOR_MIN_LENGTH)); /* add a NULL disc. ACL to the security descriptor */ OSL_VERIFY(InitializeSecurityDescriptor(pSecDesc, SECURITY_DESCRIPTOR_REVISION)); OSL_VERIFY(SetSecurityDescriptorDacl(pSecDesc, TRUE, nullptr, FALSE)); - pSecAttr = static_cast< PSECURITY_ATTRIBUTES >(rtl_allocateMemory(sizeof(SECURITY_ATTRIBUTES))); + pSecAttr = static_cast< PSECURITY_ATTRIBUTES >(malloc(sizeof(SECURITY_ATTRIBUTES))); pSecAttr->nLength = sizeof(SECURITY_ATTRIBUTES); pSecAttr->lpSecurityDescriptor = pSecDesc; pSecAttr->bInheritHandle = TRUE; diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 92d61b93ada9..f1e223bd34cd 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -147,7 +147,7 @@ oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident) if (hProcess) { - pProcImpl = static_cast< oslProcessImpl*>( rtl_allocateMemory(sizeof(oslProcessImpl)) ); + pProcImpl = static_cast< oslProcessImpl*>( malloc(sizeof(oslProcessImpl)) ); pProcImpl->m_hProcess = hProcess; pProcImpl->m_IdProcess = Ident; } @@ -163,7 +163,7 @@ void SAL_CALL osl_freeProcessHandle(oslProcess Process) { CloseHandle(static_cast<oslProcessImpl*>(Process)->m_hProcess); - rtl_freeMemory(Process); + free(Process); } } diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx index b65a942cb9d4..a2e4021f0f1f 100644 --- a/sal/osl/w32/procimpl.cxx +++ b/sal/osl/w32/procimpl.cxx @@ -546,7 +546,7 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO( CloseHandle(process_info.hThread); oslProcessImpl* pProcImpl = static_cast<oslProcessImpl*>( - rtl_allocateMemory(sizeof(oslProcessImpl))); + malloc(sizeof(oslProcessImpl))); if (pProcImpl != nullptr) { diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx index 6d9be8dd2930..e25e35cbdc24 100644 --- a/sal/osl/w32/socket.cxx +++ b/sal/osl/w32/socket.cxx @@ -236,7 +236,7 @@ void destroySocketImpl(oslSocketImpl *pImpl) { if (pImpl) { - rtl_freeMemory (pImpl); + free (pImpl); } } @@ -285,7 +285,7 @@ static void destroySocketAddr( oslSocketAddr addr ) #if OSL_DEBUG_LEVEL > 0 g_nSocketAddr --; #endif - rtl_freeMemory( addr ); + free( addr ); } oslSocketAddr SAL_CALL osl_createEmptySocketAddr(oslAddrFamily Family) @@ -475,7 +475,7 @@ oslHostAddr SAL_CALL osl_createHostAddr ( return nullptr; } - pAddr= static_cast<oslHostAddr>(rtl_allocateMemory (sizeof (struct oslHostAddrImpl))); + pAddr= static_cast<oslHostAddr>(malloc (sizeof (struct oslHostAddrImpl))); if (pAddr == nullptr) { @@ -595,7 +595,7 @@ void SAL_CALL osl_destroyHostAddr(oslHostAddr pAddr) if (pAddr->pSockAddr) osl_destroySocketAddr( pAddr->pSockAddr ); - rtl_freeMemory (pAddr); + free (pAddr); } } @@ -1623,7 +1623,7 @@ oslSocketSet SAL_CALL osl_createSocketSet() { oslSocketSetImpl* pSet; - pSet = static_cast<oslSocketSetImpl*>(rtl_allocateMemory(sizeof(oslSocketSetImpl))); + pSet = static_cast<oslSocketSetImpl*>(malloc(sizeof(oslSocketSetImpl))); if(pSet) { @@ -1636,7 +1636,7 @@ oslSocketSet SAL_CALL osl_createSocketSet() void SAL_CALL osl_destroySocketSet (oslSocketSet Set) { if(Set) - rtl_freeMemory(Set); + free(Set); } void SAL_CALL osl_clearSocketSet (oslSocketSet Set) diff --git a/sal/osl/w32/thread.cxx b/sal/osl/w32/thread.cxx index 716e299f2a50..a0f46b7e5229 100644 --- a/sal/osl/w32/thread.cxx +++ b/sal/osl/w32/thread.cxx @@ -448,14 +448,14 @@ void osl_callThreadKeyCallbackOnThreadDetach(void) oslThreadKey SAL_CALL osl_createThreadKey(oslThreadKeyCallbackFunction pCallback) { - PTLS pTls = static_cast<PTLS>(rtl_allocateMemory( sizeof(TLS) )); + PTLS pTls = static_cast<PTLS>(malloc( sizeof(TLS) )); if ( pTls ) { pTls->pfnCallback = pCallback; if ( DWORD(-1) == (pTls->dwIndex = TlsAlloc()) ) { - rtl_freeMemory( pTls ); + free( pTls ); pTls = nullptr; } else @@ -473,7 +473,7 @@ void SAL_CALL osl_destroyThreadKey(oslThreadKey Key) RemoveKeyFromList( pTls ); TlsFree( pTls->dwIndex ); - rtl_freeMemory( pTls ); + free( pTls ); } } |