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

📄 cmalloc.cpp

📁 eC++编译器源码
💻 CPP
字号:
/***
*malloc.h - declarations and definitions for memory allocation functions
*Purpose:
*   Contains the function declarations for memory allocation functions.
*
****/
#pragma cmalloc
#include <SYSTEM.h>
#include <Storage.h>

void free(ADDRESS &p)
{
  long *p1;
  typedef unsigned int c;
  p1 = p-LONG(sizeof(long)*2);
  DEALLOCATE(p, c(TRUNC(*p1)));
};

ADDRESS malloc(unsigned int size)
{
  long *p;
  INC(size, sizeof(long));
  ALLOCATE(p, size);
  *p = LONG(size);
  return ADDRESS(p)+LONG(sizeof(long)*2);
};

void cmalloc(void)
{
};

⌨️ 快捷键说明

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