summaryrefslogtreecommitdiff
path: root/sal/rtl/alloc_global.cxx
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2017-07-22 22:07:41 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2017-07-22 22:47:03 +1000
commite29ee03d1aff5fd8ff2a2af01f49bc036e612f6e (patch)
treeaad8aaaf134678b0f3030e5436804bf71a228b9c /sal/rtl/alloc_global.cxx
parent2ee84fe096f9bfaf141a1cad57f1103be688c744 (diff)
rtl: remove comment cruft from alloc files
Change-Id: Ibac120af6879739091aacefef5c773649e222f85
Diffstat (limited to 'sal/rtl/alloc_global.cxx')
-rw-r--r--sal/rtl/alloc_global.cxx71
1 files changed, 11 insertions, 60 deletions
diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx
index e17df316acbe..a16550589960 100644
--- a/sal/rtl/alloc_global.cxx
+++ b/sal/rtl/alloc_global.cxx
@@ -38,12 +38,6 @@ static void determine_alloc_mode()
alloc_mode = (getenv("G_SLICE") == nullptr ? AllocMode::CUSTOM : AllocMode::SYSTEM);
}
-/* ================================================================= *
- *
- * custom allocator internals.
- *
- * ================================================================= */
-
static const sal_Size g_alloc_sizes[] =
{
/* powers of 2**(1/4) */
@@ -78,14 +72,7 @@ static rtl_cache_type * g_alloc_table[RTL_MEMORY_CACHED_LIMIT >> RTL_MEMALIGN_SH
static rtl_arena_type * gp_alloc_arena = nullptr;
-/* ================================================================= *
- *
- * custom allocator implementation.
- *
- * ================================================================= */
-
-void *
-SAL_CALL rtl_allocateMemory_CUSTOM (sal_Size n) SAL_THROW_EXTERN_C()
+void * SAL_CALL rtl_allocateMemory_CUSTOM(sal_Size n) SAL_THROW_EXTERN_C()
{
void * p = nullptr;
if (n > 0)
@@ -124,8 +111,6 @@ try_alloc:
return p;
}
-/* ================================================================= */
-
void SAL_CALL rtl_freeMemory_CUSTOM (void * p) SAL_THROW_EXTERN_C()
{
if (p != nullptr)
@@ -140,8 +125,6 @@ void SAL_CALL rtl_freeMemory_CUSTOM (void * p) SAL_THROW_EXTERN_C()
}
}
-/* ================================================================= */
-
void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXTERN_C()
{
if (n > 0)
@@ -173,12 +156,6 @@ void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXT
#endif
-/* ================================================================= *
- *
- * custom allocator initialization / finalization.
- *
- * ================================================================= */
-
void rtl_memory_init()
{
#if !defined(FORCE_SYSALLOC)
@@ -219,11 +196,8 @@ void rtl_memory_init()
}
}
#endif
- // SAL_INFO("sal.rtl", "rtl_memory_init completed");
}
-/* ================================================================= */
-
void rtl_memory_fini()
{
#if !defined(FORCE_SYSALLOC)
@@ -250,37 +224,24 @@ void rtl_memory_fini()
gp_alloc_arena = nullptr;
}
#endif
- // SAL_INFO("sal.rtl", "rtl_memory_fini completed");
}
-/* ================================================================= *
- *
- * system allocator implementation.
- *
- * ================================================================= */
-
-void * SAL_CALL rtl_allocateMemory_SYSTEM (sal_Size n)
+void * SAL_CALL rtl_allocateMemory_SYSTEM(sal_Size n)
{
return malloc (n);
}
-/* ================================================================= */
-
-void SAL_CALL rtl_freeMemory_SYSTEM (void * p)
+void SAL_CALL rtl_freeMemory_SYSTEM(void * p)
{
free (p);
}
-/* ================================================================= */
-
-void * SAL_CALL rtl_reallocateMemory_SYSTEM (void * p, sal_Size n)
+void * SAL_CALL rtl_reallocateMemory_SYSTEM(void * p, sal_Size n)
{
return realloc (p, n);
}
-/* ================================================================= */
-
-void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
+void* SAL_CALL rtl_allocateMemory(sal_Size n) SAL_THROW_EXTERN_C()
{
SAL_WARN_IF(
n >= SAL_MAX_INT32, "sal.rtl",
@@ -303,7 +264,7 @@ void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
#endif
}
-void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
+void* SAL_CALL rtl_reallocateMemory(void * p, sal_Size n) SAL_THROW_EXTERN_C()
{
SAL_WARN_IF(
n >= SAL_MAX_INT32, "sal.rtl",
@@ -326,7 +287,7 @@ void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
#endif
}
-void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
+void SAL_CALL rtl_freeMemory(void * p) SAL_THROW_EXTERN_C()
{
#if !defined(FORCE_SYSALLOC)
while (true)
@@ -348,13 +309,7 @@ void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
#endif
}
-/* ================================================================= *
- *
- * rtl_(allocate|free)ZeroMemory() implementation.
- *
- * ================================================================= */
-
-void * SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
+void * SAL_CALL rtl_allocateZeroMemory(sal_Size n) SAL_THROW_EXTERN_C()
{
void * p = rtl_allocateMemory (n);
if (p != nullptr)
@@ -362,9 +317,7 @@ void * SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
return p;
}
-/* ================================================================= */
-
-void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
+void SAL_CALL rtl_freeZeroMemory(void * p, sal_Size n) SAL_THROW_EXTERN_C()
{
if (p != nullptr)
{
@@ -373,16 +326,14 @@ void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
}
}
-void* SAL_CALL rtl_allocateAlignedMemory (sal_Size Alignment, sal_Size Bytes) SAL_THROW_EXTERN_C()
+void* SAL_CALL rtl_allocateAlignedMemory(sal_Size Alignment, sal_Size Bytes) SAL_THROW_EXTERN_C()
{
return osl_aligned_alloc(Alignment, Bytes);
}
-void SAL_CALL rtl_freeAlignedMemory (void* Ptr) SAL_THROW_EXTERN_C()
+void SAL_CALL rtl_freeAlignedMemory(void* Ptr) SAL_THROW_EXTERN_C()
{
osl_aligned_free(Ptr);
}
-/* ================================================================= */
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */