I use boost::object_pool in my program, but I found some problems, it can not quit. Below is the code. Don't suggest me use boost::pool. The boost::pool is no problem, just discuss the boost::object_pool. Could anybody help me?
#include <iostream>
#include <boost/pool/object_pool.hpp>
int main(void) {
    boost::object_pool<int> p;
    int count = 1000*1000;
    int** pv = new int*[count];
    for (int i = 0; i < count; i++)
            pv[i] = p.construct();
    for (int i = 0; i < count; i++)
            p.destroy(pv[i]);
    delete [] pv; 
    return 0;
}
This program can not quit normally. Why?
 
                        
On my machine, this program works correctly, if very slowly.
The loop calling "destroy" is very slow; it appears to have a O(N^2) bit in it; at least, for each 10x increase in the size of the loops, the run time increases by a factor of 90.
Here are some timings: