Skip to content

Commit bbd03e7

Browse files
committed
clang/gcc compatibility
1 parent 80b1f9b commit bbd03e7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/main-override.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
#include <string.h>
1515
#include <math.h>
1616

17-
#if defined(_WIN32)
1817
extern "C" void* RPMALLOC_CDECL pvalloc(size_t size);
1918
extern "C" void* RPMALLOC_CDECL valloc(size_t size);
20-
#endif
2119

2220
static size_t _hardware_threads;
2321

@@ -75,10 +73,10 @@ test_alloc(void) {
7573
return -1;
7674
}
7775
if (reinterpret_cast<uintptr_t>(p) < config->page_size) {
78-
fprintf(stderr, "FAIL: pvalloc did not align size to page size (%llu)\n", rpmalloc_usable_size(p));
76+
fprintf(stderr, "FAIL: pvalloc did not align size to page size (%lu)\n", static_cast<uintptr_t>(rpmalloc_usable_size(p)));
7977
return -1;
8078
}
81-
free(p);
79+
rpfree(p);
8280

8381
printf("Allocation tests passed\n");
8482
return 0;
@@ -89,6 +87,7 @@ test_free(void) {
8987
free(rpmalloc(371));
9088
free(new int);
9189
free(new int[16]);
90+
free(pvalloc(1275));
9291
printf("Free tests passed\n");
9392
return 0;
9493
}

0 commit comments

Comments
 (0)