⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bspmemory.c

📁 [Game.Programming].Academic - Graphics Gems (6 books source code)
💻 C
字号:
/* bspMemory.c: module to allocate and free memory and also to count them. * Copyright (c) Norman Chin  */#include "bsp.h"		#include <malloc.h>static long memoryCount= 0L;/* Allocates memory of num bytes */char *MYMALLOC(unsigned num){   char *memory= malloc(num);	/* checked for null by caller */   ++memoryCount;		/* increment memory counter for debugging */   return(memory);} /* myMalloc() *//* Frees memory pointed to by ptr */void MYFREE(char *ptr) {   --memoryCount;		/* decrement memory counter for debugging */   free(ptr);} /* myFree() *//* Returns how many memory blocks are still allocated up to this point */long MYMEMORYCOUNT(void){   return(memoryCount);} /* myMemoryCount() *//*** bspMemory.c ***/

⌨️ 快捷键说明

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