Boost.Pool
프로그래밍 언어/boost 2015. 4. 28. 10:58
boost::pool일반적 풀 인터페이스 boost::malloc()새로운 메모리 할당 boost::pool::free명시적으로 메모리 할당 해제 (이 처리를 하지 않아도 자동으로 free됨) Colored By Color Scripter™123456789101112// pool { // sizeof(int) 바이트 전용 할당자 boost::pool p(sizeof(int)); // 풀 할당 int* a = (int*)p.malloc(); *a = 10; // 명시적으로 메모리 해제 p.free(a); } boost::object_pool오브젝트(객체) 풀 인터페이스 boost::construct()새로운 메모리 할당 boost::object_pool::destroy()명시적으로 소멸자 호출 (이 처리를..