Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e2c60649
Kaydet (Commit)
e2c60649
authored
Eki 31, 2011
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved sal/rtl/source/alloc_* files from C to C++, for easier maintenance.
üst
2a6aeea9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
91 additions
and
124 deletions
+91
-124
rtllifecycle.h
sal/inc/internal/rtllifecycle.h
+20
-2
dllentry.c
sal/osl/w32/dllentry.c
+1
-5
alloc_arena.cxx
sal/rtl/source/alloc_arena.cxx
+17
-19
alloc_arena.hxx
sal/rtl/source/alloc_arena.hxx
+6
-17
alloc_cache.cxx
sal/rtl/source/alloc_cache.cxx
+21
-29
alloc_cache.hxx
sal/rtl/source/alloc_cache.hxx
+9
-23
alloc_fini.cxx
sal/rtl/source/alloc_fini.cxx
+7
-10
alloc_global.cxx
sal/rtl/source/alloc_global.cxx
+6
-6
alloc_impl.hxx
sal/rtl/source/alloc_impl.hxx
+3
-12
locale.cxx
sal/rtl/source/locale.cxx
+1
-1
No files found.
sal/inc/internal/rtl
_locale_init
.h
→
sal/inc/internal/rtl
lifecycle
.h
Dosyayı görüntüle @
e2c60649
...
...
@@ -27,13 +27,31 @@
* instead of those above.
*/
#ifndef INCLUDED_SAL_INTERNAL_RTL
_LOCALE_INIT
_H
#define INCLUDED_SAL_INTERNAL_RTL
_LOCALE_INIT
_H
#ifndef INCLUDED_SAL_INTERNAL_RTL
LIFECYCLE
_H
#define INCLUDED_SAL_INTERNAL_RTL
LIFECYCLE
_H
#if defined __cplusplus
extern
"C"
{
#endif
void
rtl_arena_init
();
void
rtl_arena_fini
();
void
ensureArenaSingleton
();
void
rtl_cache_init
();
void
rtl_cache_fini
();
void
ensureCacheSingleton
();
void
rtl_memory_init
();
void
rtl_memory_fini
();
void
ensureMemorySingleton
();
void
rtl_locale_init
();
void
rtl_locale_fini
();
...
...
sal/osl/w32/dllentry.c
Dosyayı görüntüle @
e2c60649
...
...
@@ -44,7 +44,7 @@
#include <osl/mutex.h>
#include <sal/types.h>
#include "internal/rtl
_locale_init
.h"
#include "internal/rtl
lifecycle
.h"
//------------------------------------------------------------------------------
// externals
...
...
@@ -56,10 +56,6 @@ extern CRITICAL_SECTION g_ThreadKeyListCS;
extern
oslMutex
g_Mutex
;
extern
oslMutex
g_CurrentDirectoryMutex
;
extern
void
rtl_memory_fini
(
void
);
extern
void
rtl_cache_fini
(
void
);
extern
void
rtl_arena_fini
(
void
);
#ifdef __MINGW32__
typedef
void
(
*
func_ptr
)
(
void
);
...
...
sal/rtl/source/alloc_arena.c
→
sal/rtl/source/alloc_arena.c
xx
Dosyayı görüntüle @
e2c60649
...
...
@@ -27,10 +27,11 @@
************************************************************************/
#define _BSD_SOURCE
/* sys/mman.h: MAP_ANON */
#include "alloc_arena.h"
#include "alloc_arena.h
xx
"
#include "alloc_impl.h"
#include "alloc_impl.h
xx
"
#include "internal/once.h"
#include "internal/rtllifecycle.h"
#include "sal/macros.h"
#include "osl/diagnose.h"
...
...
@@ -54,7 +55,7 @@ struct rtl_arena_list_st
rtl_arena_type
m_arena_head
;
};
static
struct
rtl_arena_list_st
g_arena_list
;
static
rtl_arena_list_st
g_arena_list
;
/** gp_arena_arena
...
...
@@ -89,7 +90,7 @@ SAL_CALL rtl_machdep_free (
);
static
sal_Size
rtl_machdep_pagesize
(
void
);
rtl_machdep_pagesize
(
);
/** gp_default_arena
...
...
@@ -142,7 +143,8 @@ rtl_arena_segment_populate (
rtl_arena_segment_type
*
span
;
sal_Size
size
=
rtl_machdep_pagesize
();
span
=
rtl_machdep_alloc
(
gp_machdep_arena
,
&
size
);
span
=
static_cast
<
rtl_arena_segment_type
*
>
(
rtl_machdep_alloc
(
gp_machdep_arena
,
&
size
));
if
(
span
!=
0
)
{
rtl_arena_segment_type
*
first
,
*
last
,
*
head
;
...
...
@@ -473,7 +475,7 @@ rtl_arena_segment_alloc (
if
(
!
RTL_MEMORY_ISP2
(
size
))
{
int
msb
=
highbit
(
size
);
if
(
RTL_ARENA_FREELIST_SIZE
==
SAL_INT_CAST
(
size_t
,
msb
))
if
(
RTL_ARENA_FREELIST_SIZE
==
sal
::
static_int_cast
<
size_t
>
(
msb
))
{
/* highest possible freelist: fall back to first fit */
rtl_arena_segment_type
*
head
,
*
segment
;
...
...
@@ -708,7 +710,7 @@ rtl_arena_destructor (void * obj)
OSL_ASSERT
(
arena
->
m_hash_size
==
RTL_ARENA_HASH_SIZE
);
OSL_ASSERT
(
arena
->
m_hash_shift
==
SAL_INT_CAST
(
unsigned
,
highbit
(
arena
->
m_hash_size
)
-
1
));
sal
::
static_int_cast
<
unsigned
>
(
highbit
(
arena
->
m_hash_size
)
-
1
));
}
/* ================================================================= */
...
...
@@ -748,7 +750,7 @@ rtl_arena_activate (
if
(
arena
->
m_qcache_max
>
0
)
{
char
name
[
RTL_ARENA_NAME_LENGTH
+
1
];
char
name
buf
[
RTL_ARENA_NAME_LENGTH
+
1
];
int
i
,
n
=
(
arena
->
m_qcache_max
>>
arena
->
m_quantum_shift
);
sal_Size
size
=
n
*
sizeof
(
rtl_cache_type
*
);
...
...
@@ -761,8 +763,8 @@ rtl_arena_activate (
for
(
i
=
1
;
i
<=
n
;
i
++
)
{
size
=
i
*
arena
->
m_quantum
;
(
void
)
snprintf
(
name
,
sizeof
(
name
),
"%s_%lu"
,
arena
->
m_name
,
size
);
arena
->
m_qcache_ptr
[
i
-
1
]
=
rtl_cache_create
(
name
,
size
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
arena
,
RTL_CACHE_FLAG_QUANTUMCACHE
);
(
void
)
snprintf
(
name
buf
,
sizeof
(
namebuf
),
"%s_%lu"
,
arena
->
m_name
,
size
);
arena
->
m_qcache_ptr
[
i
-
1
]
=
rtl_cache_create
(
name
buf
,
size
,
0
,
NULL
,
NULL
,
NULL
,
NULL
,
arena
,
RTL_CACHE_FLAG_QUANTUMCACHE
);
}
}
...
...
@@ -909,8 +911,6 @@ rtl_arena_deactivate (
*
* ================================================================= */
extern
void
ensureArenaSingleton
();
/** rtl_arena_create()
*/
rtl_arena_type
*
...
...
@@ -921,14 +921,12 @@ SAL_CALL rtl_arena_create (
rtl_arena_type
*
source_arena
,
void
*
(
SAL_CALL
*
source_alloc
)(
rtl_arena_type
*
,
sal_Size
*
),
void
(
SAL_CALL
*
source_free
)
(
rtl_arena_type
*
,
void
*
,
sal_Size
),
int
flags
int
)
SAL_THROW_EXTERN_C
()
{
rtl_arena_type
*
result
=
0
;
sal_Size
size
=
sizeof
(
rtl_arena_type
);
(
void
)
flags
;
/* unused */
try_alloc:
result
=
(
rtl_arena_type
*
)
rtl_arena_alloc
(
gp_arena_arena
,
&
size
);
if
(
result
!=
0
)
...
...
@@ -978,7 +976,7 @@ try_alloc:
void
SAL_CALL
rtl_arena_destroy
(
rtl_arena_type
*
arena
)
)
SAL_THROW_EXTERN_C
()
{
if
(
arena
!=
0
)
{
...
...
@@ -1243,7 +1241,7 @@ SAL_CALL rtl_machdep_free (
/** rtl_machdep_pagesize()
*/
static
sal_Size
rtl_machdep_pagesize
(
void
)
rtl_machdep_pagesize
(
)
{
#if defined(SAL_UNX)
#if defined(FREEBSD) || defined(NETBSD) || defined(DRAGONFLY)
...
...
@@ -1265,7 +1263,7 @@ rtl_machdep_pagesize (void)
* ================================================================= */
void
rtl_arena_init
(
void
)
rtl_arena_init
(
)
{
{
/* list of arenas */
...
...
@@ -1333,7 +1331,7 @@ rtl_arena_init (void)
/* ================================================================= */
void
rtl_arena_fini
(
void
)
rtl_arena_fini
(
)
{
if
(
gp_arena_arena
!=
0
)
{
...
...
sal/rtl/source/alloc_arena.h
→
sal/rtl/source/alloc_arena.h
xx
Dosyayı görüntüle @
e2c60649
...
...
@@ -26,22 +26,17 @@
*
************************************************************************/
#ifndef INCLUDED_RTL_ALLOC_ARENA_H
#define INCLUDED_RTL_ALLOC_ARENA_H
#ifndef INCLUDED_RTL_ALLOC_ARENA_H
XX
#define INCLUDED_RTL_ALLOC_ARENA_H
XX
#include "sal/types.h"
#include "rtl/alloc.h"
#include "alloc_impl.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#include "alloc_impl.hxx"
/** rtl_arena_stat_type
* @internal
*/
typedef
struct
rtl_arena_stat_st
rtl_arena_stat_type
;
struct
rtl_arena_stat_st
struct
rtl_arena_stat_type
{
sal_uInt64
m_alloc
;
sal_uInt64
m_free
;
...
...
@@ -59,8 +54,7 @@ struct rtl_arena_stat_st
#define RTL_ARENA_SEGMENT_TYPE_FREE ((sal_Size)(0x04))
#define RTL_ARENA_SEGMENT_TYPE_USED ((sal_Size)(0x08))
typedef
struct
rtl_arena_segment_st
rtl_arena_segment_type
;
struct
rtl_arena_segment_st
struct
rtl_arena_segment_type
{
/* segment list linkage */
rtl_arena_segment_type
*
m_snext
;
...
...
@@ -130,11 +124,6 @@ struct rtl_arena_st
*/
extern
rtl_arena_type
*
gp_default_arena
;
#ifdef __cplusplus
}
#endif
#endif
/* INCLUDED_RTL_ALLOC_ARENA_H */
#endif
/* INCLUDED_RTL_ALLOC_ARENA_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal/rtl/source/alloc_cache.c
→
sal/rtl/source/alloc_cache.c
xx
Dosyayı görüntüle @
e2c60649
...
...
@@ -26,10 +26,11 @@
*
************************************************************************/
#include "alloc_cache.h"
#include "alloc_impl.h"
#include "alloc_arena.h"
#include "alloc_cache.h
xx
"
#include "alloc_impl.h
xx
"
#include "alloc_arena.h
xx
"
#include "internal/once.h"
#include "internal/rtllifecycle.h"
#include "sal/macros.h"
#include "osl/diagnose.h"
...
...
@@ -67,7 +68,7 @@ struct rtl_cache_list_st
int
m_update_done
;
};
static
struct
rtl_cache_list_st
g_cache_list
;
static
rtl_cache_list_st
g_cache_list
;
/** gp_cache_arena
...
...
@@ -257,12 +258,10 @@ rtl_cache_hash_remove (
/** rtl_cache_slab_constructor()
*/
static
int
rtl_cache_slab_constructor
(
void
*
obj
,
void
*
arg
)
rtl_cache_slab_constructor
(
void
*
obj
,
void
*
)
{
rtl_cache_slab_type
*
slab
=
(
rtl_cache_slab_type
*
)(
obj
);
(
void
)
arg
;
/* unused */
QUEUE_START_NAMED
(
slab
,
slab_
);
slab
->
m_ntypes
=
0
;
...
...
@@ -273,7 +272,7 @@ rtl_cache_slab_constructor (void * obj, void * arg)
/** rtl_cache_slab_destructor()
*/
static
void
rtl_cache_slab_destructor
(
void
*
obj
,
void
*
arg
)
rtl_cache_slab_destructor
(
void
*
obj
,
void
*
)
{
#if OSL_DEBUG_LEVEL == 0
(
void
)
obj
;
/* unused */
...
...
@@ -286,8 +285,6 @@ rtl_cache_slab_destructor (void * obj, void * arg)
/* assure no longer referenced */
OSL_ASSERT
(
slab
->
m_ntypes
==
0
);
#endif
/* OSL_DEBUG_LEVEL */
(
void
)
arg
;
/* unused */
}
...
...
@@ -587,13 +584,11 @@ rtl_cache_slab_free (
/** rtl_cache_magazine_constructor()
*/
static
int
rtl_cache_magazine_constructor
(
void
*
obj
,
void
*
arg
)
rtl_cache_magazine_constructor
(
void
*
obj
,
void
*
)
{
rtl_cache_magazine_type
*
mag
=
(
rtl_cache_magazine_type
*
)(
obj
);
/* @@@ sal_Size size = (sal_Size)(arg); @@@ */
(
void
)
arg
;
/* unused */
mag
->
m_mag_next
=
0
;
mag
->
m_mag_size
=
RTL_CACHE_MAGAZINE_SIZE
;
mag
->
m_mag_used
=
0
;
...
...
@@ -605,7 +600,7 @@ rtl_cache_magazine_constructor (void * obj, void * arg)
/** rtl_cache_magazine_destructor()
*/
static
void
rtl_cache_magazine_destructor
(
void
*
obj
,
void
*
arg
)
rtl_cache_magazine_destructor
(
void
*
obj
,
void
*
)
{
#if OSL_DEBUG_LEVEL == 0
(
void
)
obj
;
/* unused */
...
...
@@ -618,8 +613,6 @@ rtl_cache_magazine_destructor (void * obj, void * arg)
/* assure no longer referenced */
OSL_ASSERT
(
mag
->
m_mag_used
==
0
);
#endif
/* OSL_DEBUG_LEVEL */
(
void
)
arg
;
/* unused */
}
...
...
@@ -1110,8 +1103,6 @@ rtl_cache_deactivate (
*
* ================================================================= */
extern
void
ensureCacheSingleton
();
/** rtl_cache_create()
*/
rtl_cache_type
*
...
...
@@ -1379,7 +1370,7 @@ SAL_CALL rtl_cache_free (
* @precond g_cache_list.m_lock initialized
*/
static
void
rtl_cache_wsupdate_init
(
void
);
rtl_cache_wsupdate_init
(
);
/** rtl_cache_wsupdate_wait()
...
...
@@ -1395,7 +1386,7 @@ rtl_cache_wsupdate_wait (
*
*/
static
void
rtl_cache_wsupdate_fini
(
void
);
rtl_cache_wsupdate_fini
(
);
/* ================================================================= */
...
...
@@ -1407,7 +1398,7 @@ static void *
rtl_cache_wsupdate_all
(
void
*
arg
);
static
void
rtl_cache_wsupdate_init
(
void
)
rtl_cache_wsupdate_init
(
)
{
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
g_cache_list
.
m_lock
));
g_cache_list
.
m_update_done
=
0
;
...
...
@@ -1426,8 +1417,8 @@ rtl_cache_wsupdate_wait (unsigned int seconds)
{
if
(
seconds
>
0
)
{
struct
timeval
now
;
struct
timespec
wakeup
;
timeval
now
;
timespec
wakeup
;
gettimeofday
(
&
now
,
0
);
wakeup
.
tv_sec
=
now
.
tv_sec
+
(
seconds
);
...
...
@@ -1441,7 +1432,7 @@ rtl_cache_wsupdate_wait (unsigned int seconds)
}
static
void
rtl_cache_wsupdate_fini
(
void
)
rtl_cache_wsupdate_fini
(
)
{
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
g_cache_list
.
m_lock
));
g_cache_list
.
m_update_done
=
1
;
...
...
@@ -1460,7 +1451,7 @@ static DWORD WINAPI
rtl_cache_wsupdate_all
(
void
*
arg
);
static
void
rtl_cache_wsupdate_init
(
void
)
rtl_cache_wsupdate_init
(
)
{
DWORD
dwThreadId
;
...
...
@@ -1485,7 +1476,7 @@ rtl_cache_wsupdate_wait (unsigned int seconds)
}
static
void
rtl_cache_wsupdate_fini
(
void
)
rtl_cache_wsupdate_fini
(
)
{
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
g_cache_list
.
m_lock
));
g_cache_list
.
m_update_done
=
1
;
...
...
@@ -1572,7 +1563,8 @@ static DWORD WINAPI
#endif
/* SAL_UNX || SAL_W32 */
rtl_cache_wsupdate_all
(
void
*
arg
)
{
unsigned
int
seconds
=
(
unsigned
int
)
SAL_INT_CAST
(
sal_uIntPtr
,
arg
);
unsigned
int
seconds
=
sal
::
static_int_cast
<
unsigned
int
>
(
reinterpret_cast
<
sal_uIntPtr
>
(
arg
));
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
g_cache_list
.
m_lock
));
while
(
!
g_cache_list
.
m_update_done
)
...
...
@@ -1603,7 +1595,7 @@ rtl_cache_wsupdate_all (void * arg)
* ================================================================= */
void
rtl_cache_init
(
void
)
rtl_cache_init
(
)
{
{
/* list of caches */
...
...
@@ -1705,7 +1697,7 @@ rtl_cache_init (void)
/* ================================================================= */
void
rtl_cache_fini
(
void
)
rtl_cache_fini
(
)
{
if
(
gp_cache_arena
!=
0
)
{
...
...
sal/rtl/source/alloc_cache.h
→
sal/rtl/source/alloc_cache.h
xx
Dosyayı görüntüle @
e2c60649
...
...
@@ -26,22 +26,17 @@
*
************************************************************************/
#ifndef INCLUDED_RTL_ALLOC_CACHE_H
#define INCLUDED_RTL_ALLOC_CACHE_H
#ifndef INCLUDED_RTL_ALLOC_CACHE_H
XX
#define INCLUDED_RTL_ALLOC_CACHE_H
XX
#include "sal/types.h"
#include "rtl/alloc.h"
#include "alloc_impl.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#include "alloc_impl.hxx"
/** rtl_cache_stat_type
* @internal
*/
typedef
struct
rtl_cache_stat_st
rtl_cache_stat_type
;
struct
rtl_cache_stat_st
struct
rtl_cache_stat_type
{
sal_uInt64
m_alloc
;
sal_uInt64
m_free
;
...
...
@@ -54,8 +49,7 @@ struct rtl_cache_stat_st
/** rtl_cache_bufctl_type
* @internal
*/
typedef
struct
rtl_cache_bufctl_st
rtl_cache_bufctl_type
;
struct
rtl_cache_bufctl_st
struct
rtl_cache_bufctl_type
{
rtl_cache_bufctl_type
*
m_next
;
/* linkage */
...
...
@@ -67,8 +61,7 @@ struct rtl_cache_bufctl_st
/** rtl_cache_slab_type
* @internal
*/
typedef
struct
rtl_cache_slab_st
rtl_cache_slab_type
;
struct
rtl_cache_slab_st
struct
rtl_cache_slab_type
{
rtl_cache_slab_type
*
m_slab_next
;
/* slab linkage */
rtl_cache_slab_type
*
m_slab_prev
;
/* slab linkage */
...
...
@@ -86,8 +79,7 @@ struct rtl_cache_slab_st
*/
#define RTL_CACHE_MAGAZINE_SIZE 61
typedef
struct
rtl_cache_magazine_st
rtl_cache_magazine_type
;
struct
rtl_cache_magazine_st
struct
rtl_cache_magazine_type
{
rtl_cache_magazine_type
*
m_mag_next
;
/* depot linkage */
...
...
@@ -101,8 +93,7 @@ struct rtl_cache_magazine_st
/** rtl_cache_depot_type
* @internal
*/
typedef
struct
rtl_cache_depot_st
rtl_cache_depot_type
;
struct
rtl_cache_depot_st
struct
rtl_cache_depot_type
{
/* magazine list */
rtl_cache_magazine_type
*
m_mag_next
;
/* linkage */
...
...
@@ -175,11 +166,6 @@ struct rtl_cache_st
rtl_cache_stat_type
m_cpu_stats
;
};
#ifdef __cplusplus
}
#endif
#endif
/* INCLUDED_RTL_ALLOC_CACHE_H */
#endif
/* INCLUDED_RTL_ALLOC_CACHE_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal/rtl/source/alloc_fini.cxx
Dosyayı görüntüle @
e2c60649
...
...
@@ -28,10 +28,8 @@
#include <rtl/instance.hxx>
#include "internal/rtl
_locale_init
.h"
#include "internal/rtl
lifecycle
.h"
extern
"C"
void
rtl_memory_fini
();
extern
"C"
void
rtl_memory_init
();
namespace
{
struct
rtlMemorySingleton
...
...
@@ -48,13 +46,12 @@ namespace
class
theMemorySingleton
:
public
rtl
::
Static
<
rtlMemorySingleton
,
theMemorySingleton
>
{};
}
extern
"C"
void
ensureMemorySingleton
()
void
ensureMemorySingleton
()
{
theMemorySingleton
::
get
();
}
extern
"C"
void
rtl_cache_fini
();
extern
"C"
void
rtl_cache_init
();
namespace
{
struct
rtlCacheSingleton
...
...
@@ -71,13 +68,12 @@ namespace
class
theCacheSingleton
:
public
rtl
::
Static
<
rtlCacheSingleton
,
theCacheSingleton
>
{};
}
extern
"C"
void
ensureCacheSingleton
()
void
ensureCacheSingleton
()
{
theCacheSingleton
::
get
();
}
extern
"C"
void
rtl_arena_fini
();
extern
"C"
void
rtl_arena_init
();
namespace
{
struct
rtlArenaSingleton
...
...
@@ -94,7 +90,8 @@ namespace
class
theArenaSingleton
:
public
rtl
::
Static
<
rtlArenaSingleton
,
theArenaSingleton
>
{};
}
extern
"C"
void
ensureArenaSingleton
()
void
ensureArenaSingleton
()
{
theArenaSingleton
::
get
();
}
...
...
sal/rtl/source/alloc_global.c
→
sal/rtl/source/alloc_global.c
xx
Dosyayı görüntüle @
e2c60649
...
...
@@ -26,7 +26,7 @@
*
************************************************************************/
#include "alloc_impl.h"
#include "alloc_impl.h
xx
"
#include "rtl/alloc.h"
#include <sal/macros.h>
#include <osl/diagnose.h>
...
...
@@ -34,10 +34,12 @@
#include <string.h>
#include <stdio.h>
#include "internal/rtllifecycle.h"
AllocMode
alloc_mode
=
AMode_UNSET
;
#if !defined(FORCE_SYSALLOC)
static
void
determine_alloc_mode
(
void
)
static
void
determine_alloc_mode
()
{
OSL_ASSERT
(
alloc_mode
==
AMode_UNSET
);
alloc_mode
=
(
getenv
(
"G_SLICE"
)
==
NULL
?
AMode_CUSTOM
:
AMode_SYSTEM
);
...
...
@@ -92,8 +94,6 @@ static rtl_cache_type * g_alloc_table[RTL_MEMORY_CACHED_LIMIT >> RTL_MEMALIGN_SH
static
rtl_arena_type
*
gp_alloc_arena
=
0
;
extern
void
ensureMemorySingleton
();
/* ================================================================= *
*
* custom allocator implemenation.
...
...
@@ -194,7 +194,7 @@ void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXT
*
* ================================================================= */
void
rtl_memory_init
(
void
)
void
rtl_memory_init
(
)
{
#if !defined(FORCE_SYSALLOC)
{
...
...
@@ -239,7 +239,7 @@ void rtl_memory_init (void)
/* ================================================================= */
void
rtl_memory_fini
(
void
)
void
rtl_memory_fini
(
)
{
#if !defined(FORCE_SYSALLOC)
int
i
,
n
;
...
...
sal/rtl/source/alloc_impl.h
→
sal/rtl/source/alloc_impl.h
xx
Dosyayı görüntüle @
e2c60649
...
...
@@ -26,16 +26,11 @@
*
************************************************************************/
#ifndef INCLUDED_RTL_ALLOC_IMPL_H
#define INCLUDED_RTL_ALLOC_IMPL_H
#ifndef INCLUDED_RTL_ALLOC_IMPL_H
XX
#define INCLUDED_RTL_ALLOC_IMPL_H
XX
#include "sal/types.h"
#ifdef __cplusplus
extern
"C"
{
#endif
/** Alignment macros
*/
#if SAL_TYPES_ALIGNMENT4 > 1
...
...
@@ -275,10 +270,6 @@ typedef enum { AMode_CUSTOM, AMode_SYSTEM, AMode_UNSET } AllocMode;
extern
AllocMode
alloc_mode
;
#ifdef __cplusplus
}
#endif
#endif
/* INCLUDED_RTL_ALLOC_IMPL_H */
#endif
/* INCLUDED_RTL_ALLOC_IMPL_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal/rtl/source/locale.cxx
Dosyayı görüntüle @
e2c60649
...
...
@@ -32,7 +32,7 @@
#include "rtl/alloc.h"
#include "internal/once.h"
#include "internal/rtl
_locale_init
.h"
#include "internal/rtl
lifecycle
.h"
static
sal_Int32
RTL_HASHTABLE_SIZE
[]
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment