File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1414#include < string.h>
1515#include < math.h>
1616
17- #if defined(_WIN32)
1817extern " C" void * RPMALLOC_CDECL pvalloc (size_t size);
1918extern " C" void * RPMALLOC_CDECL valloc (size_t size);
20- #endif
2119
2220static 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}
You can’t perform that action at this time.
0 commit comments