summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-03-06 22:57:45 (GMT)
committerJason Evans <je@fb.com>2012-03-08 00:19:19 (GMT)
commitd81e4bdd5c991bd5642c8b859ef1f752b51cd9be (patch)
treeafa22483ea5fc9e1ae5402667eac1e1b5c398b85 /test
parent4507f34628dfae26e6b0a6faa13e5f9a49600616 (diff)
downloadjemalloc-d81e4bdd5c991bd5642c8b859ef1f752b51cd9be.zip
jemalloc-d81e4bdd5c991bd5642c8b859ef1f752b51cd9be.tar.gz
jemalloc-d81e4bdd5c991bd5642c8b859ef1f752b51cd9be.tar.bz2
Implement malloc_vsnprintf().
Implement malloc_vsnprintf() (a subset of vsnprintf(3)) as well as several other printing functions based on it, so that formatted printing can be relied upon without concern for inducing a dependency on floating point runtime support. Replace malloc_write() calls with malloc_*printf() where doing so simplifies the code. Add name mangling for library-private symbols in the data and BSS sections. Adjust CONF_HANDLE_*() macros in malloc_conf_init() to expose all opt_* variable use to cpp so that proper mangling occurs.
Diffstat (limited to 'test')
-rw-r--r--test/allocm.c14
-rw-r--r--test/posix_memalign.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/test/allocm.c b/test/allocm.c
index 137e74c..3aa0fd2 100644
--- a/test/allocm.c
+++ b/test/allocm.c
@@ -77,14 +77,14 @@ main(void)
r = nallocm(&nsz, sz, ALLOCM_ALIGN(alignment));
if (r == ALLOCM_SUCCESS) {
fprintf(stderr,
- "Expected error for nallocm(&nsz, %zu, 0x%x)\n",
+ "Expected error for nallocm(&nsz, %zu, %#x)\n",
sz, ALLOCM_ALIGN(alignment));
}
rsz = 0;
r = allocm(&p, &rsz, sz, ALLOCM_ALIGN(alignment));
if (r == ALLOCM_SUCCESS) {
fprintf(stderr,
- "Expected error for allocm(&p, %zu, 0x%x)\n",
+ "Expected error for allocm(&p, %zu, %#x)\n",
sz, ALLOCM_ALIGN(alignment));
}
if (nsz != rsz)
@@ -105,7 +105,7 @@ main(void)
r = allocm(&p, &rsz, sz, ALLOCM_ALIGN(alignment));
if (r == ALLOCM_SUCCESS) {
fprintf(stderr,
- "Expected error for allocm(&p, %zu, 0x%x)\n",
+ "Expected error for allocm(&p, %zu, %#x)\n",
sz, ALLOCM_ALIGN(alignment));
}
@@ -119,14 +119,14 @@ main(void)
r = nallocm(&nsz, sz, ALLOCM_ALIGN(alignment));
if (r == ALLOCM_SUCCESS) {
fprintf(stderr,
- "Expected error for nallocm(&nsz, %zu, 0x%x)\n",
+ "Expected error for nallocm(&nsz, %zu, %#x)\n",
sz, ALLOCM_ALIGN(alignment));
}
rsz = 0;
r = allocm(&p, &rsz, sz, ALLOCM_ALIGN(alignment));
if (r == ALLOCM_SUCCESS) {
fprintf(stderr,
- "Expected error for allocm(&p, %zu, 0x%x)\n",
+ "Expected error for allocm(&p, %zu, %#x)\n",
sz, ALLOCM_ALIGN(alignment));
}
if (nsz != rsz)
@@ -150,7 +150,7 @@ main(void)
if (r != ALLOCM_SUCCESS) {
fprintf(stderr,
"nallocm() error for size %zu"
- " (0x%zx): %d\n",
+ " (%#zx): %d\n",
sz, sz, r);
exit(1);
}
@@ -160,7 +160,7 @@ main(void)
if (r != ALLOCM_SUCCESS) {
fprintf(stderr,
"allocm() error for size %zu"
- " (0x%zx): %d\n",
+ " (%#zx): %d\n",
sz, sz, r);
exit(1);
}
diff --git a/test/posix_memalign.c b/test/posix_memalign.c
index 5abb420..0ea35c8 100644
--- a/test/posix_memalign.c
+++ b/test/posix_memalign.c
@@ -100,7 +100,7 @@ main(void)
alignment, size);
if (err) {
fprintf(stderr,
- "Error for size %zu (0x%zx): %s\n",
+ "Error for size %zu (%#zx): %s\n",
size, size, strerror(err));
exit(1);
}