mimalloc-sys 0.1.4

Rust FFI bindings to mimalloc
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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;
}