mem_alloc.cpp

来自「最快速的可满足性分析工具软件」· C++ 代码 · 共 39 行

CPP
39
字号
/* * mem_alloc.cpp: This file contains memory allocation functions. * Every memory alloction of the solver are made through functions in * this file (see structures.h). *  * The following functions are in this file: * - my_malloc * - my_calloc * * */#include <stdlib.h>#include <stdio.h>#include <string.h>void* my_malloc(size_t size){  void* ans = malloc(size);  if(ans==NULL){    printf("c Insufficient memory in malloc\n");    printf("s UNKNOWN\n");    exit(0);  }  return ans;}void* my_calloc(size_t num,size_t size){    void* ans = calloc(num,size);    if(ans==NULL){    printf("c Insufficient memory in calloc\n");    printf("s UNKNOWN\n");    exit(0);  }  return ans;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?