summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2015-07-10 21:33:00 (GMT)
committerJason Evans <jasone@canonware.com>2015-07-10 23:09:40 (GMT)
commitae93d6bf364e9db9f9ee69c3e5f9df110d8685a4 (patch)
tree1566ce500524072247a1a75c50bc9aafbe18b4a7 /test/unit
parentdde067264db6b801f7ffae9616a35dba5d2d9ad4 (diff)
downloadjemalloc-ae93d6bf364e9db9f9ee69c3e5f9df110d8685a4.zip
jemalloc-ae93d6bf364e9db9f9ee69c3e5f9df110d8685a4.tar.gz
jemalloc-ae93d6bf364e9db9f9ee69c3e5f9df110d8685a4.tar.bz2
Avoid function prototype incompatibilities.
Add various function attributes to the exported functions to give the compiler more information to work with during optimization, and also specify throw() when compiling with C++ on Linux, in order to adequately match what __THROW does in glibc. This resolves #237.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/bitmap.c8
-rw-r--r--test/unit/rtree.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/test/unit/bitmap.c b/test/unit/bitmap.c
index 4ea94f8..7da583d 100644
--- a/test/unit/bitmap.c
+++ b/test/unit/bitmap.c
@@ -23,7 +23,7 @@ TEST_BEGIN(test_bitmap_init)
bitmap_info_init(&binfo, i);
{
size_t j;
- bitmap_t *bitmap = malloc(sizeof(bitmap_t) *
+ bitmap_t *bitmap = (bitmap_t *)malloc(sizeof(bitmap_t) *
bitmap_info_ngroups(&binfo));
bitmap_init(bitmap, &binfo);
@@ -46,7 +46,7 @@ TEST_BEGIN(test_bitmap_set)
bitmap_info_init(&binfo, i);
{
size_t j;
- bitmap_t *bitmap = malloc(sizeof(bitmap_t) *
+ bitmap_t *bitmap = (bitmap_t *)malloc(sizeof(bitmap_t) *
bitmap_info_ngroups(&binfo));
bitmap_init(bitmap, &binfo);
@@ -69,7 +69,7 @@ TEST_BEGIN(test_bitmap_unset)
bitmap_info_init(&binfo, i);
{
size_t j;
- bitmap_t *bitmap = malloc(sizeof(bitmap_t) *
+ bitmap_t *bitmap = (bitmap_t *)malloc(sizeof(bitmap_t) *
bitmap_info_ngroups(&binfo));
bitmap_init(bitmap, &binfo);
@@ -98,7 +98,7 @@ TEST_BEGIN(test_bitmap_sfu)
bitmap_info_init(&binfo, i);
{
ssize_t j;
- bitmap_t *bitmap = malloc(sizeof(bitmap_t) *
+ bitmap_t *bitmap = (bitmap_t *)malloc(sizeof(bitmap_t) *
bitmap_info_ngroups(&binfo));
bitmap_init(bitmap, &binfo);
diff --git a/test/unit/rtree.c b/test/unit/rtree.c
index 3f95554..3d75bd0 100644
--- a/test/unit/rtree.c
+++ b/test/unit/rtree.c
@@ -4,7 +4,7 @@ static rtree_node_elm_t *
node_alloc(size_t nelms)
{
- return (calloc(nelms, sizeof(rtree_node_elm_t)));
+ return ((rtree_node_elm_t *)calloc(nelms, sizeof(rtree_node_elm_t)));
}
static void