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
f3876e3f
Kaydet (Commit)
f3876e3f
authored
Mar 28, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
these VALGRIND allocator annotations never worked for me, just busted memcheck
üst
043ddca9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
83 deletions
+0
-83
alloc_arena.cxx
sal/rtl/source/alloc_arena.cxx
+0
-15
alloc_cache.cxx
sal/rtl/source/alloc_cache.cxx
+0
-37
alloc_impl.hxx
sal/rtl/source/alloc_impl.hxx
+0
-31
No files found.
sal/rtl/source/alloc_arena.cxx
Dosyayı görüntüle @
f3876e3f
...
...
@@ -922,7 +922,6 @@ try_alloc:
if
(
result
!=
0
)
{
rtl_arena_type
*
arena
=
result
;
VALGRIND_CREATE_MEMPOOL
(
arena
,
0
,
0
);
rtl_arena_constructor
(
arena
);
if
(
!
source_arena
)
...
...
@@ -945,7 +944,6 @@ try_alloc:
{
rtl_arena_deactivate
(
arena
);
rtl_arena_destructor
(
arena
);
VALGRIND_DESTROY_MEMPOOL
(
arena
);
rtl_arena_free
(
gp_arena_arena
,
arena
,
size
);
}
}
...
...
@@ -972,7 +970,6 @@ SAL_CALL rtl_arena_destroy (
{
rtl_arena_deactivate
(
arena
);
rtl_arena_destructor
(
arena
);
VALGRIND_DESTROY_MEMPOOL
(
arena
);
rtl_arena_free
(
gp_arena_arena
,
arena
,
sizeof
(
rtl_arena_type
));
}
}
...
...
@@ -1033,10 +1030,6 @@ SAL_CALL rtl_arena_alloc (
rtl_arena_hash_insert
(
arena
,
segment
);
/* DEBUG ONLY: mark allocated, undefined */
OSL_DEBUG_ONLY
(
memset
((
void
*
)(
segment
->
m_addr
),
0x77777777
,
segment
->
m_size
));
VALGRIND_MEMPOOL_ALLOC
(
arena
,
segment
->
m_addr
,
segment
->
m_size
);
(
*
pSize
)
=
segment
->
m_size
;
addr
=
(
void
*
)(
segment
->
m_addr
);
}
...
...
@@ -1086,11 +1079,6 @@ SAL_CALL rtl_arena_free (
{
rtl_arena_segment_type
*
next
,
*
prev
;
/* DEBUG ONLY: mark unallocated, undefined */
VALGRIND_MEMPOOL_FREE
(
arena
,
segment
->
m_addr
);
/* OSL_DEBUG_ONLY() */
RTL_VALGRIND_IGNORE_VAL
VALGRIND_MAKE_MEM_UNDEFINED
(
segment
->
m_addr
,
segment
->
m_size
);
OSL_DEBUG_ONLY
(
memset
((
void
*
)(
segment
->
m_addr
),
0x33333333
,
segment
->
m_size
));
/* coalesce w/ adjacent free segment(s) */
rtl_arena_segment_coalesce
(
arena
,
segment
);
...
...
@@ -1266,7 +1254,6 @@ rtl_arena_init()
static
rtl_arena_type
g_machdep_arena
;
assert
(
gp_machdep_arena
==
0
);
VALGRIND_CREATE_MEMPOOL
(
&
g_machdep_arena
,
0
,
0
);
rtl_arena_constructor
(
&
g_machdep_arena
);
gp_machdep_arena
=
rtl_arena_activate
(
...
...
@@ -1283,7 +1270,6 @@ rtl_arena_init()
static
rtl_arena_type
g_default_arena
;
assert
(
gp_default_arena
==
0
);
VALGRIND_CREATE_MEMPOOL
(
&
g_default_arena
,
0
,
0
);
rtl_arena_constructor
(
&
g_default_arena
);
gp_default_arena
=
rtl_arena_activate
(
...
...
@@ -1302,7 +1288,6 @@ rtl_arena_init()
static
rtl_arena_type
g_arena_arena
;
assert
(
gp_arena_arena
==
0
);
VALGRIND_CREATE_MEMPOOL
(
&
g_arena_arena
,
0
,
0
);
rtl_arena_constructor
(
&
g_arena_arena
);
gp_arena_arena
=
rtl_arena_activate
(
...
...
sal/rtl/source/alloc_cache.cxx
Dosyayı görüntüle @
f3876e3f
...
...
@@ -483,11 +483,6 @@ rtl_cache_slab_alloc (
addr
=
(
void
*
)
rtl_cache_hash_insert
(
cache
,
bufctl
);
else
addr
=
bufctl
;
/* DEBUG ONLY: mark allocated, undefined */
/* OSL_DEBUG_ONLY() */
RTL_VALGRIND_IGNORE_VAL
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
);
}
RTL_MEMORY_LOCK_RELEASE
(
&
(
cache
->
m_slab_lock
));
...
...
@@ -510,11 +505,6 @@ rtl_cache_slab_free (
RTL_MEMORY_LOCK_ACQUIRE
(
&
(
cache
->
m_slab_lock
));
/* DEBUG ONLY: mark unallocated, undefined */
VALGRIND_MEMPOOL_FREE
(
cache
,
addr
);
/* OSL_DEBUG_ONLY() */
RTL_VALGRIND_IGNORE_VAL
VALGRIND_MAKE_MEM_UNDEFINED
(
addr
,
cache
->
m_type_size
);
OSL_DEBUG_ONLY
(
memset
(
addr
,
0x33333333
,
cache
->
m_type_size
));
/* determine slab from addr */
if
(
cache
->
m_features
&
RTL_CACHE_FEATURE_HASH
)
{
...
...
@@ -611,13 +601,8 @@ rtl_cache_magazine_clear (
void
*
obj
=
mag
->
m_objects
[
mag
->
m_mag_used
-
1
];
mag
->
m_objects
[
mag
->
m_mag_used
-
1
]
=
0
;
/* DEBUG ONLY: mark cached object allocated, undefined */
VALGRIND_MEMPOOL_ALLOC
(
cache
,
obj
,
cache
->
m_type_size
);
if
(
cache
->
m_destructor
!=
0
)
{
/* DEBUG ONLY: keep constructed object defined */
RTL_VALGRIND_IGNORE_VAL
VALGRIND_MAKE_MEM_DEFINED
(
obj
,
cache
->
m_type_size
);
/* destruct object */
(
cache
->
m_destructor
)(
obj
,
cache
->
m_userarg
);
}
...
...
@@ -1107,7 +1092,6 @@ try_alloc:
if
(
result
!=
0
)
{
rtl_cache_type
*
cache
=
result
;
VALGRIND_CREATE_MEMPOOL
(
cache
,
0
,
0
);
(
void
)
rtl_cache_constructor
(
cache
);
if
(
!
source
)
...
...
@@ -1135,7 +1119,6 @@ try_alloc:
/* activation failed */
rtl_cache_deactivate
(
cache
);
rtl_cache_destructor
(
cache
);
VALGRIND_DESTROY_MEMPOOL
(
cache
);
rtl_arena_free
(
gp_cache_arena
,
cache
,
size
);
}
}
...
...
@@ -1161,7 +1144,6 @@ void SAL_CALL rtl_cache_destroy (
{
rtl_cache_deactivate
(
cache
);
rtl_cache_destructor
(
cache
);
VALGRIND_DESTROY_MEMPOOL
(
cache
);
rtl_arena_free
(
gp_cache_arena
,
cache
,
sizeof
(
rtl_cache_type
));
}
}
...
...
@@ -1204,14 +1186,6 @@ SAL_CALL rtl_cache_alloc (
if
((
curr
!=
0
)
&&
(
curr
->
m_mag_used
>
0
))
{
obj
=
curr
->
m_objects
[
--
curr
->
m_mag_used
];
#if defined(HAVE_VALGRIND_MEMCHECK_H)
VALGRIND_MEMPOOL_ALLOC
(
cache
,
obj
,
cache
->
m_type_size
);
if
(
cache
->
m_constructor
!=
0
)
{
/* keep constructed object defined */
RTL_VALGRIND_IGNORE_VAL
VALGRIND_MAKE_MEM_DEFINED
(
obj
,
cache
->
m_type_size
);
}
#endif
/* HAVE_VALGRIND_MEMCHECK_H */
cache
->
m_cpu_stats
.
m_alloc
+=
1
;
RTL_MEMORY_LOCK_RELEASE
(
&
(
cache
->
m_depot_lock
));
...
...
@@ -1289,9 +1263,6 @@ SAL_CALL rtl_cache_free (
if
((
curr
!=
0
)
&&
(
curr
->
m_mag_used
<
curr
->
m_mag_size
))
{
curr
->
m_objects
[
curr
->
m_mag_used
++
]
=
obj
;
#if defined(HAVE_VALGRIND_MEMCHECK_H)
VALGRIND_MEMPOOL_FREE
(
cache
,
obj
);
#endif
/* HAVE_VALGRIND_MEMCHECK_H */
cache
->
m_cpu_stats
.
m_free
+=
1
;
RTL_MEMORY_LOCK_RELEASE
(
&
(
cache
->
m_depot_lock
));
...
...
@@ -1604,7 +1575,6 @@ rtl_cache_init()
static
rtl_cache_type
g_cache_magazine_cache
;
assert
(
gp_cache_magazine_cache
==
0
);
VALGRIND_CREATE_MEMPOOL
(
&
g_cache_magazine_cache
,
0
,
0
);
(
void
)
rtl_cache_constructor
(
&
g_cache_magazine_cache
);
gp_cache_magazine_cache
=
rtl_cache_activate
(
...
...
@@ -1629,7 +1599,6 @@ rtl_cache_init()
static
rtl_cache_type
g_cache_slab_cache
;
assert
(
gp_cache_slab_cache
==
0
);
VALGRIND_CREATE_MEMPOOL
(
&
g_cache_slab_cache
,
0
,
0
);
(
void
)
rtl_cache_constructor
(
&
g_cache_slab_cache
);
gp_cache_slab_cache
=
rtl_cache_activate
(
...
...
@@ -1651,7 +1620,6 @@ rtl_cache_init()
static
rtl_cache_type
g_cache_bufctl_cache
;
assert
(
gp_cache_bufctl_cache
==
0
);
VALGRIND_CREATE_MEMPOOL
(
&
g_cache_bufctl_cache
,
0
,
0
);
(
void
)
rtl_cache_constructor
(
&
g_cache_bufctl_cache
);
gp_cache_bufctl_cache
=
rtl_cache_activate
(
...
...
@@ -1689,21 +1657,18 @@ rtl_cache_fini()
cache
=
gp_cache_bufctl_cache
,
gp_cache_bufctl_cache
=
0
;
rtl_cache_deactivate
(
cache
);
rtl_cache_destructor
(
cache
);
VALGRIND_DESTROY_MEMPOOL
(
cache
);
}
if
(
gp_cache_slab_cache
!=
0
)
{
cache
=
gp_cache_slab_cache
,
gp_cache_slab_cache
=
0
;
rtl_cache_deactivate
(
cache
);
rtl_cache_destructor
(
cache
);
VALGRIND_DESTROY_MEMPOOL
(
cache
);
}
if
(
gp_cache_magazine_cache
!=
0
)
{
cache
=
gp_cache_magazine_cache
,
gp_cache_magazine_cache
=
0
;
rtl_cache_deactivate
(
cache
);
rtl_cache_destructor
(
cache
);
VALGRIND_DESTROY_MEMPOOL
(
cache
);
}
if
(
gp_cache_arena
!=
0
)
{
...
...
@@ -1735,6 +1700,4 @@ rtl_cache_fini()
// SAL_INFO("sal", "rtl_cache_fini completed");
}
/* ================================================================= */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal/rtl/source/alloc_impl.hxx
Dosyayı görüntüle @
f3876e3f
...
...
@@ -235,37 +235,6 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
#define RTL_CACHE_FLAG_NOMAGAZINE (1 << 13)
/* w/o magazine layer */
#define RTL_CACHE_FLAG_QUANTUMCACHE (2 << 13)
/* used as arena quantum cache */
/** Valgrind support macros.
*/
#if !defined(HAVE_MEMCHECK_H) || (OSL_DEBUG_LEVEL == 0)
#if !defined(NVALGRIND)
#define NVALGRIND 1
#endif
/* ! NVALGRIND */
#endif
/* ! HAVE_MEMCHECK_H || (OSL_DEBUG_LEVEL == 0) */
#if defined(NVALGRIND)
#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
#define VALGRIND_MAKE_MEM_DEFINED(addr, size)
#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)
#define VALGRIND_FREELIKE_BLOCK(addr, rzB)
#define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)
#define VALGRIND_DESTROY_MEMPOOL(pool)
#define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)
#define VALGRIND_MEMPOOL_FREE(pool, addr)
#define RTL_VALGRIND_IGNORE_VAL
#elif defined(HAVE_MEMCHECK_H)
#include <memcheck.h>
/* valgrind macros contain unused variables... */
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#if GCC_VERSION >= 40600 && !defined __clang__
#pragma GCC diagnostic warning "-Wunused-but-set-variable"
#endif
#define RTL_VALGRIND_IGNORE_VAL (void)
#endif
/* NVALGRIND || HAVE_MEMCHECK_H */
typedef
enum
{
AMode_CUSTOM
,
AMode_SYSTEM
,
AMode_UNSET
}
AllocMode
;
extern
AllocMode
alloc_mode
;
...
...
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