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
1f7d7438
Kaydet (Commit)
1f7d7438
authored
Kas 29, 2017
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sal: check for HAVE_GCC_BUILTIN_ATOMIC only once in interlck
Change-Id: Iaddc79cee0c06f72f636a3d35959922fd78f4e20
üst
bc4e8de8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
interlck.cxx
sal/osl/unx/interlck.cxx
+9
-17
No files found.
sal/osl/unx/interlck.cxx
Dosyayı görüntüle @
1f7d7438
...
...
@@ -25,14 +25,20 @@
#error please use asm/interlck_sparc.s
#elif defined (__sun) && defined ( X86 )
#error please use asm/interlck_x86.s
#elif HAVE_GCC_BUILTIN_ATOMIC
oslInterlockedCount
SAL_CALL
osl_incrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
return
__sync_add_and_fetch
(
pCount
,
1
);
}
oslInterlockedCount
SAL_CALL
osl_decrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
return
__sync_sub_and_fetch
(
pCount
,
1
);
}
#elif defined ( __GNUC__ ) && ( defined ( X86 ) || defined ( X86_64 ) )
/* That's possible on x86-64 too since oslInterlockedCount is a sal_Int32 */
oslInterlockedCount
SAL_CALL
osl_incrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
#if HAVE_GCC_BUILTIN_ATOMIC
return
__sync_add_and_fetch
(
pCount
,
1
);
#else
register
oslInterlockedCount
nCount
asm
(
"%eax"
);
nCount
=
1
;
__asm__
__volatile__
(
...
...
@@ -42,14 +48,10 @@ oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount*
:
/* nothing */
:
"memory"
);
return
++
nCount
;
#endif
}
oslInterlockedCount
SAL_CALL
osl_decrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
#if HAVE_GCC_BUILTIN_ATOMIC
return
__sync_sub_and_fetch
(
pCount
,
1
);
#else
register
oslInterlockedCount
nCount
asm
(
"%eax"
);
nCount
=
-
1
;
__asm__
__volatile__
(
...
...
@@ -59,16 +61,6 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount*
:
/* nothing */
:
"memory"
);
return
--
nCount
;
#endif
}
#elif HAVE_GCC_BUILTIN_ATOMIC
oslInterlockedCount
SAL_CALL
osl_incrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
return
__sync_add_and_fetch
(
pCount
,
1
);
}
oslInterlockedCount
SAL_CALL
osl_decrementInterlockedCount
(
oslInterlockedCount
*
pCount
)
{
return
__sync_sub_and_fetch
(
pCount
,
1
);
}
#else
/* use only if nothing else works, expensive due to single mutex for all reference counts */
...
...
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