//
// MemoryPool.h
//
// $Id: //poco/1.4/Foundation/include/Poco/MemoryPool.h#1 $
//
// Library: Foundation
// Package: Core
// Module: MemoryPool
//
// Definition of the MemoryPool class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
/*
//z 2011-06-23 15:13:07@is2120.CSDN 转载请注明出处
设计思想:
比较简单,申请若干个(128)固定大小的内存块,
将各内存块指针存放在vector中,申请则出vector,释放则回收到vec中去。
*/
#ifndef Foundation_MemoryPool_INCLUDED
#define Foundation_MemoryPool_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Mutex.h"
#include <vector>
#include <cstddef>
namespace Poco {
/*
14:01 2011-6-23
一个固定大小内存块的pool
这个class的主要目的是加速内存分配
同时在相同大小的块一遍又一遍分配时避免了内存碎片
*/
class Foundation_API MemoryPool
/// A simple pool for fixed-size memory blocks.