x509cmsmemoryfuncs.c

来自「pgp soucecode pgp soucecode」· C语言 代码 · 共 42 行

C
42
字号
#include "x509CMS.h"

#include "pgpMemoryMgr.h"

PKIMemoryMgr X509CMSMemoryMgr = {
    NULL,
    x509CMSAllocProc,
    x509CMSReallocProc,
    x509CMSDeallocProc
};

void *
x509CMSAllocProc (
        PKIMemoryMgr    *mem,
        size_t          requestSize
)
{
    return (PGPNewData ((PGPMemoryMgrRef) mem->customValue, requestSize, 0)); 
}

int
x509CMSDeallocProc (
        PKIMemoryMgr    *mem,
        void            *allocation
)
{
	(void) mem;
	
    PGPFreeData (allocation);
    return 0;
}

int
x509CMSReallocProc (
	PKIMemoryMgr	*mem,
	void		**allocation,
	size_t		requestSize)
{
    PGPReallocData ((PGPMemoryMgrRef) mem->customValue, allocation, requestSize, 0);
    return 0;
}

⌨️ 快捷键说明

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