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

📄 heap.cc

📁 VRTX 商用嵌入式实时操作系统
💻 CC
字号:
/***************************************************************************
*
*		Copyright (c) 1993 READY SYSTEMS CORPORATION.
*
*	All rights reserved. READY SYSTEMS' source code is an unpublished
*	work and the use of a copyright notice does not imply otherwise.
*	This source code contains confidential, trade secret material of
*	READY SYSTEMS. Any attempt or participation in deciphering, decoding,
*	reverse engineering or in any way altering the source code is
*	strictly prohibited, unless the prior written consent of
*	READY SYSTEMS is obtained.
*
*
*	Module Name:		heap.cc
*
*	Identification:		@(#) 1.3 heap.cc
*
*	Date:			4/26/93  17:15:23
*
****************************************************************************
*/

#include "heap.h"

Heap::Heap (void *base, unsigned length, unsigned page_log2)
{
  int err;
  hid = sc_hcreate ((char *) base, length, page_log2, &err);
}

Heap::~Heap ()
{
  int err;
  sc_hdelete (hid, 1, &err);
}

void *
Heap::malloc (unsigned size)
{
  int err;
  return (void *) sc_halloc (hid, size, &err);
}

void
Heap::free (void *ptr)
{
  int err;
  sc_hfree (hid, (char *) ptr, &err);
}

void
Heap::inquiry (int info[3])
{
  int err;
  sc_hinquiry (info, hid, &err);
}

int
Heap::id ()
{
  return hid;
}

⌨️ 快捷键说明

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