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

📄 pgpmempool.h

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 H
字号:
/*____________________________________________________________________________
        Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: pgpMemPool.h,v 1.7 2002/08/06 20:11:00 dallen Exp $
____________________________________________________________________________*/

#ifndef Included_pgpMemPool_h
#define Included_pgpMemPool_h


#include "pgpOpaqueStructs.h"
#include "pgpPubTypes.h"
#include "pgpMemoryMgr.h"
#include "pgpTypes.h"

PGP_BEGIN_C_DECLARATIONS


struct MemPool
{
	PGPContextRef	context;
	
	struct PoolBuf *head;
	char *freeptr;
	unsigned freespace;
	unsigned chunksize;	/* Default starting point */
	unsigned long totalsize;
	int (*purge)(void *);	/* Return non-zero to retry alloc */
	void *purgearg;
};



/*
 * Nice clean interfaces
 */
#define memPoolIsEmpty(pool) ((pool)->head == 0)

void 
memPoolInit(PGPContextRef context, MemPool *pool);

void 
memPoolSetPurge(MemPool *pool, int (*purge)(void *), void *arg);

void 
memPoolEmpty(MemPool *pool);

void 
memPoolCutBack(MemPool *dest, MemPool const *cutback);

void  *
memPoolAlloc(MemPool *pool, unsigned len, unsigned alignment);

PGPMemoryMgrRef
pgpMemPoolMemoryMgr( MemPool *pool );


#ifdef DEADCODE
char const  *
memPoolStore(MemPool *pool, char const *str);
#endif

#define memPoolNew(pool, type) memPoolAlloc(pool, sizeof(type), alignof(type))

PGP_END_C_DECLARATIONS

#endif /* Included_pgpMemPool_h */

⌨️ 快捷键说明

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