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
ce906b80
Kaydet (Commit)
ce906b80
authored
Agu 06, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
skip tricky allocators on G_SLICE=always-malloc
üst
c2e61f08
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
8 deletions
+45
-8
alloc_arena.c
sal/rtl/source/alloc_arena.c
+11
-0
alloc_cache.c
sal/rtl/source/alloc_cache.c
+28
-0
alloc_global.c
sal/rtl/source/alloc_global.c
+2
-5
alloc_impl.h
sal/rtl/source/alloc_impl.h
+4
-3
No files found.
sal/rtl/source/alloc_arena.c
Dosyayı görüntüle @
ce906b80
...
...
@@ -37,6 +37,8 @@
#include <string.h>
#include <stdio.h>
extern
AllocMode
alloc_mode
;
/* ================================================================= *
*
* arena internals.
...
...
@@ -999,6 +1001,9 @@ SAL_CALL rtl_arena_alloc (
if
((
arena
!=
0
)
&&
(
pSize
!=
0
))
{
if
(
alloc_mode
==
AMode_SYSTEM
)
return
rtl_allocateMemory
(
*
pSize
);
sal_Size
size
=
RTL_MEMORY_ALIGN
((
*
pSize
),
arena
->
m_quantum
);
if
(
size
>
arena
->
m_qcache_max
)
{
...
...
@@ -1072,6 +1077,12 @@ SAL_CALL rtl_arena_free (
{
if
(
arena
!=
0
)
{
if
(
alloc_mode
==
AMode_SYSTEM
)
{
rtl_freeMemory
(
addr
);
return
;
}
size
=
RTL_MEMORY_ALIGN
(
size
,
arena
->
m_quantum
);
if
(
size
>
arena
->
m_qcache_max
)
{
...
...
sal/rtl/source/alloc_cache.c
Dosyayı görüntüle @
ce906b80
...
...
@@ -41,6 +41,8 @@
#include <stdio.h>
#endif
extern
AllocMode
alloc_mode
;
/* ================================================================= *
*
* cache internals.
...
...
@@ -498,6 +500,7 @@ rtl_cache_slab_alloc (
addr
=
bufctl
;
/* DEBUG ONLY: mark allocated, undefined */
/* OSL_DEBUG_ONLY() */
VALGRIND_MAKE_MEM_UNDEFINED
(
addr
,
cache
->
m_type_size
);
OSL_DEBUG_ONLY
(
memset
(
addr
,
0x77777777
,
cache
->
m_type_size
));
VALGRIND_MEMPOOL_ALLOC
(
cache
,
addr
,
cache
->
m_type_size
);
}
...
...
@@ -1203,6 +1206,20 @@ SAL_CALL rtl_cache_alloc (
if
(
cache
==
0
)
return
(
0
);
if
(
alloc_mode
==
AMode_SYSTEM
)
{
obj
=
rtl_allocateMemory
(
cache
->
m_type_size
);
if
((
obj
!=
0
)
&&
(
cache
->
m_constructor
!=
0
))
{
if
(
!
((
cache
->
m_constructor
)(
obj
,
cache
->
m_userarg
)))
{
/* construction failure */
rtl_freeMemory
(
obj
),
obj
=
0
;
}
}
return
obj
;
}
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
cache
->
m_depot_lock
));
if
(
cache
->
m_cpu_curr
!=
0
)
{
...
...
@@ -1278,6 +1295,17 @@ SAL_CALL rtl_cache_free (
{
if
((
obj
!=
0
)
&&
(
cache
!=
0
))
{
if
(
alloc_mode
==
AMode_SYSTEM
)
{
if
(
cache
->
m_destructor
!=
0
)
{
/* destruct object */
(
cache
->
m_destructor
)(
obj
,
cache
->
m_userarg
);
}
rtl_freeMemory
(
obj
);
return
;
}
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
cache
->
m_depot_lock
));
for
(;;)
...
...
sal/rtl/source/alloc_global.c
Dosyayı görüntüle @
ce906b80
...
...
@@ -34,12 +34,9 @@
#include <string.h>
#include <stdio.h>
#if !defined(FORCE_SYSALLOC)
typedef
enum
{
AMode_CUSTOM
,
AMode_SYSTEM
,
AMode_UNSET
}
AllocMode
;
static
AllocMode
alloc_mode
=
AMode_UNSET
;
AllocMode
alloc_mode
=
AMode_UNSET
;
#if !defined(FORCE_SYSALLOC)
static
void
determine_alloc_mode
(
void
)
{
/* This shouldn't happen, but still ... */
...
...
sal/rtl/source/alloc_impl.h
Dosyayı görüntüle @
ce906b80
...
...
@@ -260,11 +260,12 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
#define VALGRIND_MEMPOOL_FREE(pool, addr)
#elif defined(HAVE_MEMCHECK_H)
#include <memcheck.h>
#if !defined(FORCE_SYSALLOC)
#define FORCE_SYSALLOC 1
#endif
/* !FORCE_SYSALLOC */
#endif
/* NVALGRIND || HAVE_MEMCHECK_H */
typedef
enum
{
AMode_CUSTOM
,
AMode_SYSTEM
,
AMode_UNSET
}
AllocMode
;
extern
AllocMode
alloc_mode
;
#ifdef __cplusplus
}
#endif
...
...
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