mirror of
https://github.com/encounter/mimalloc.git
synced 2026-03-30 11:29:45 -07:00
18 lines
289 B
C++
18 lines
289 B
C++
|
|
#include <stdio.h>
|
||
|
|
#include <assert.h>
|
||
|
|
#include <rcmalloc.h>
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
void* p1 = rc_malloc(16);
|
||
|
|
void* p2 = rc_malloc(16);
|
||
|
|
rc_free(p1);
|
||
|
|
rc_free(p2);
|
||
|
|
p1 = rc_malloc(16);
|
||
|
|
p2 = rc_malloc(16);
|
||
|
|
rc_free(p1);
|
||
|
|
rc_free(p2);
|
||
|
|
rc_collect(true);
|
||
|
|
rc_stats_print();
|
||
|
|
return 0;
|
||
|
|
}
|