列表 3. 使用 mtrace() 进行追踪

#include <stdio.h>
#include <stdlib.h>
#include <mcheck.h>

int main() {
  char *ptr;

  mtrace();
  ptr = malloc(10);
  /*  free(ptr); */

}
© . All rights reserved.