Remove external linkage for spin_adaptive

The external linkage for spin_adaptive was not used, and the inline
declaration of spin_adaptive that was used caused a probem on FreeBSD
where CPU_SPINWAIT is implemented as a call to a static procedure for
x86 architectures.
This commit is contained in:
Ryan Libby 2017-08-07 22:00:22 -07:00 committed by David Goldblatt
parent 1ab2ab294c
commit 048c6679cd
5 changed files with 1 additions and 16 deletions

View File

@ -112,7 +112,6 @@ C_SRCS := $(srcroot)src/jemalloc.c \
$(srcroot)src/prof.c \ $(srcroot)src/prof.c \
$(srcroot)src/rtree.c \ $(srcroot)src/rtree.c \
$(srcroot)src/stats.c \ $(srcroot)src/stats.c \
$(srcroot)src/spin.c \
$(srcroot)src/sz.c \ $(srcroot)src/sz.c \
$(srcroot)src/tcache.c \ $(srcroot)src/tcache.c \
$(srcroot)src/ticker.c \ $(srcroot)src/ticker.c \

View File

@ -1,19 +1,13 @@
#ifndef JEMALLOC_INTERNAL_SPIN_H #ifndef JEMALLOC_INTERNAL_SPIN_H
#define JEMALLOC_INTERNAL_SPIN_H #define JEMALLOC_INTERNAL_SPIN_H
#ifdef JEMALLOC_SPIN_C_
# define SPIN_INLINE extern inline
#else
# define SPIN_INLINE inline
#endif
#define SPIN_INITIALIZER {0U} #define SPIN_INITIALIZER {0U}
typedef struct { typedef struct {
unsigned iteration; unsigned iteration;
} spin_t; } spin_t;
SPIN_INLINE void static inline void
spin_adaptive(spin_t *spin) { spin_adaptive(spin_t *spin) {
volatile uint32_t i; volatile uint32_t i;

View File

@ -56,7 +56,6 @@
<ClCompile Include="..\..\..\..\src\prng.c" /> <ClCompile Include="..\..\..\..\src\prng.c" />
<ClCompile Include="..\..\..\..\src\prof.c" /> <ClCompile Include="..\..\..\..\src\prof.c" />
<ClCompile Include="..\..\..\..\src\rtree.c" /> <ClCompile Include="..\..\..\..\src\rtree.c" />
<ClCompile Include="..\..\..\..\src\spin.c" />
<ClCompile Include="..\..\..\..\src\stats.c" /> <ClCompile Include="..\..\..\..\src\stats.c" />
<ClCompile Include="..\..\..\..\src\sz.c" /> <ClCompile Include="..\..\..\..\src\sz.c" />
<ClCompile Include="..\..\..\..\src\tcache.c" /> <ClCompile Include="..\..\..\..\src\tcache.c" />

View File

@ -70,9 +70,6 @@
<ClCompile Include="..\..\..\..\src\rtree.c"> <ClCompile Include="..\..\..\..\src\rtree.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\..\src\spin.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\src\stats.c"> <ClCompile Include="..\..\..\..\src\stats.c">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>

View File

@ -1,4 +0,0 @@
#define JEMALLOC_SPIN_C_
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/spin.h"