|
// TestMemoryPool.cpp : �������̨Ӧ�ó������ڵ㡣
//
#include "stdafx.h"
#include "BufferPool.h"
#include "BufferPoolW.h"
int _tmain(int argc, _TCHAR* argv[])
{
size_t initSize = 1024;
//Initialize the memory buffer
BufferPool bfA(initSize,20);
//allocate memory from the memory pool
char *p = bfA.Allocate(100);
if(p)
{
//use the memory buffer
//release memory to the memory pool
bfA.Release(p);
}
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Bony Chen, a senior software engineer, specializes in C++, COM, C#, ASP.net, ISAPI. He has nearly seven years of software development experience, and has successfully developed many influential software products, such as SPES, CSO, QQ (a famous IM tool in China).
And now he is focusing on P2P technology. He aims at being an expert in software development, software consulting, software components and computer science.
If you have any opinions or questions in software area, please contact bonyren@163.com.