summaryrefslogtreecommitdiffstats
path: root/jemalloc/test
diff options
context:
space:
mode:
authorJason Evans <je@facebook.com>2010-09-21 02:20:48 (GMT)
committerJason Evans <je@facebook.com>2010-09-21 02:20:48 (GMT)
commit355b438c854227bbf8185cb7a3ce247d271a842e (patch)
treea173a96412a2c5ac1f02ac6d3a3f1c188eeefe48 /jemalloc/test
parent6a0d2918ceede07a36a50389c1a8a95755b0a7f6 (diff)
downloadjemalloc-355b438c854227bbf8185cb7a3ce247d271a842e.zip
jemalloc-355b438c854227bbf8185cb7a3ce247d271a842e.tar.gz
jemalloc-355b438c854227bbf8185cb7a3ce247d271a842e.tar.bz2
Fix compiler warnings.
Add --enable-cc-silence, which can be used to silence harmless warnings. Fix an aliasing bug in ckh_pointer_hash().
Diffstat (limited to 'jemalloc/test')
-rw-r--r--jemalloc/test/thread_arena.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/jemalloc/test/thread_arena.c b/jemalloc/test/thread_arena.c
index d52435f..5b1058b 100644
--- a/jemalloc/test/thread_arena.c
+++ b/jemalloc/test/thread_arena.c
@@ -10,11 +10,16 @@ void *
thread_start(void *arg)
{
unsigned main_arena_ind = *(unsigned *)arg;
+ void *p;
unsigned arena_ind;
size_t size;
int err;
- JEMALLOC_P(malloc)(1);
+ p = JEMALLOC_P(malloc)(1);
+ if (p == NULL) {
+ fprintf(stderr, "%s(): Error in malloc()\n", __func__);
+ return (void *)1;
+ }
size = sizeof(arena_ind);
if ((err = JEMALLOC_P(mallctl)("thread.arena", &arena_ind, &size,
@@ -31,6 +36,7 @@ int
main(void)
{
int ret = 0;
+ void *p;
unsigned arena_ind;
size_t size;
int err;
@@ -38,7 +44,12 @@ main(void)
fprintf(stderr, "Test begin\n");
- JEMALLOC_P(malloc)(1);
+ p = JEMALLOC_P(malloc)(1);
+ if (p == NULL) {
+ fprintf(stderr, "%s(): Error in malloc()\n", __func__);
+ ret = 1;
+ goto RETURN;
+ }
size = sizeof(arena_ind);
if ((err = JEMALLOC_P(mallctl)("thread.arena", &arena_ind, &size, NULL,