Fix porting regressions.

Fix new build failures and test failures on Linux that were introduced
by the port to OS X.
This commit is contained in:
Jason Evans 2010-09-11 23:38:12 -07:00
parent 7e11b389aa
commit 8d7a94b275
3 changed files with 9 additions and 15 deletions

View File

@ -70,16 +70,16 @@ extern __thread tcache_t *tcache_tls
JEMALLOC_ATTR(tls_model("initial-exec"));
# define TCACHE_GET() tcache_tls
# define TCACHE_SET(v) do { \
tcache_tls = (v); \
tcache_tls = (tcache_t *)(v); \
pthread_setspecific(tcache_tsd, (void *)(v)); \
} while (0)
#else
extern pthread_key_t tcache_tsd;
# define TCACHE_GET() ((tcache_t *)pthread_getspecific(tcache_tsd))
# define TCACHE_SET(v) do { \
pthread_setspecific(tcache_tsd, (void *)(v)); \
} while (0)
#endif
extern pthread_key_t tcache_tsd;
/*
* Number of tcache bins. There are nbins small-object bins, plus 0 or more

View File

@ -9,7 +9,7 @@
#define CHUNK 0x100000
/* #define MAXALIGN ((size_t)0x80000000000LLU) */
#define MAXALIGN ((size_t)0x40000000LLU)
#define MAXALIGN ((size_t)0x2000000LLU)
#define NITER 4
int
@ -86,22 +86,21 @@ main(void)
for (i = 0; i < NITER; i++)
ps[i] = NULL;
for (alignment = sizeof(void *);
for (alignment = 8;
alignment <= MAXALIGN;
alignment <<= 1) {
total = 0;
fprintf(stderr, "Alignment: %zu\n", alignment);
for (size = 1;
size < 3 * alignment && size < (1U << 31);
size += (alignment >> 2) - 1) {
size += (alignment >> (LG_SIZEOF_PTR-1)) - 1) {
for (i = 0; i < NITER; i++) {
err = JEMALLOC_P(posix_memalign)(&ps[i],
alignment, size);
if (err) {
fprintf(stderr,
"Error for size 0x%x %zu : %s\n",
(unsigned)size, size,
strerror(err));
"Error for size %zu (0x%zx): %s\n",
size, size, strerror(err));
exit(1);
}
total += JEMALLOC_P(malloc_usable_size)(ps[i]);

View File

@ -22,9 +22,4 @@ Alignment: 4194304
Alignment: 8388608
Alignment: 16777216
Alignment: 33554432
Alignment: 67108864
Alignment: 134217728
Alignment: 268435456
Alignment: 536870912
Alignment: 1073741824
Test end