mirror of
https://sourceware.org/git/glibc.git
synced 2026-01-06 11:51:29 +03:00
Update.
* malloc/Makefile: Change all references to memprof into memusage. * malloc/memprof.c: Rename to... * malloc/memusage.c: ...this. New file. * malloc/memprof.sh: Rename to... * malloc/memusage.sh: ...this. New file. * malloc/memprofstat.c: Rename to... * malloc/memusagestat.c: ...this. New file.
This commit is contained in:
@@ -12,6 +12,25 @@
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU Library General Public License for more details. */
|
||||
|
||||
|
||||
/* There are 2 compare and swap synchronization primitives with
|
||||
different semantics:
|
||||
|
||||
1. compare_and_swap, which has acquire semantics (i.e. it
|
||||
completes befor subsequent writes.)
|
||||
2. compare_and_swap_with_release_semantics, which has release
|
||||
semantics (it completes after previous writes.)
|
||||
|
||||
For those platforms on which they are the same. HAS_COMPARE_AND_SWAP
|
||||
should be defined. For those platforms on which they are different,
|
||||
HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS has to be defined. */
|
||||
|
||||
#ifndef HAS_COMPARE_AND_SWAP
|
||||
#ifdef HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
|
||||
#define HAS_COMPARE_AND_SWAP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(TEST_FOR_COMPARE_AND_SWAP)
|
||||
|
||||
extern int __pthread_has_cas;
|
||||
@@ -29,6 +48,18 @@ static inline int compare_and_swap(long * ptr, long oldval, long newval,
|
||||
|
||||
#elif defined(HAS_COMPARE_AND_SWAP)
|
||||
|
||||
#ifdef HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
|
||||
|
||||
static inline int
|
||||
compare_and_swap_with_release_semantics (long * ptr, long oldval,
|
||||
long newval, int * spinlock)
|
||||
{
|
||||
return __compare_and_swap_with_release_semantics (ptr, oldval,
|
||||
newval);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static inline int compare_and_swap(long * ptr, long oldval, long newval,
|
||||
int * spinlock)
|
||||
{
|
||||
@@ -48,6 +79,10 @@ static inline int compare_and_swap(long * ptr, long oldval, long newval,
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
|
||||
#define compare_and_swap_with_release_semantics compare_and_swap
|
||||
#endif
|
||||
|
||||
/* Internal locks */
|
||||
|
||||
extern void internal_function __pthread_lock(struct _pthread_fastlock * lock,
|
||||
|
||||
Reference in New Issue
Block a user