?? part.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: partition.cc
*
* Identification: @(#) 1.4 partition.cc
*
* Date: 5/3/93 14:57:08
*
****************************************************************************
*/
#include "part.h"
Partition::Partition (void *base, unsigned length, unsigned block_size, int id)
{
int err;
if (id == -1)
pid = sc_pcreate (id, (char *) base, length, block_size, &err);
else {
sc_pcreate (id, (char *) base, length, block_size, &err);
pid = id;
}
bsize = block_size;
}
Partition::~Partition ()
{
int err;
sc_pdelete (pid, 1, &err);
}
void *
Partition::malloc (unsigned size)
{
int err;
void *ret;
if (size > bsize)
return (void *) 0;
ret = sc_gblock (pid, &err);
return err == RET_OK ? ret : (void *) 0;
}
void
Partition::free (void *ptr)
{
int err;
sc_rblock (pid, (char *) ptr, &err);
}
int
Partition::id ()
{
return pid;
}
void
Partition::extend (void *base, unsigned length)
{
int err;
sc_pextend (pid, (char *) base, length, &err);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -