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

📄 splist.h

📁 操作系统中的一个例子
💻 H
字号:
/*
 * Copyright (c) 2000-2008
 * Author: Weiming Zhou
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  
 */

#ifndef _SPLIST_H_
#define _SPLIST_H_


typedef struct SPNODE_st {
    UINT               uPos;   /* 位置,即在数组中的位置,为数组下标 */
    struct SPNODE_st * pNext;  /* 下一个节点指针 */
} SPNODE;

typedef struct SPLIST_st {
    void        *pBlock;    /* 一块连续内存 */
    SPNODE      *pHead;     /* 自由空间链表头部节点 */
    UINT        uFreeCount; /* 自由空间节点的个数 */
} SPLIST;

SPLIST * SpList_Create(UINT uSpaceCount, UINT uDataSize, UINT uPos);
void     SpList_Destroy(SPLIST *pSpList);

void   * SpList_Alloc(SPLIST *pSpList);
void     SpList_Free(SPLIST *pSpList, void *pData);


#endif /* _SPLIST_H_ */

⌨️ 快捷键说明

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