35 Pool::Pool (
string n,
unsigned long item_size,
unsigned long nitems)
46 block = malloc (nitems * item_size);
48 void **ptrlist = (
void **) malloc (
sizeof (
void *) * nitems);
50 for (
unsigned long i = 0; i < nitems; i++) {
51 ptrlist[i] =
static_cast<void *
> (
static_cast<char*
>(
block) + (i * item_size));
72 fatal <<
"CRITICAL: " <<
_name <<
" POOL OUT OF MEMORY - RECOMPILE WITH LARGER SIZE!!" <<
endmsg;
90 :
Pool (n, isize, nitems)
99 :
Pool (n, isize, nitems)
185 if (!p && must_exist) {
206 warning <<
"Pool " << p->
name() <<
" has no trash collector; a memory leak has therefore occurred" <<
endmsg;
218 :
Pool (n, isize, nitems)
236 bool did_release =
false;
LIBPBD_API const char * pthread_name()
LIBPBD_API Transmitter fatal
~MultiAllocSingleReleasePool()
RingBuffer< void * > free_list
a list of pointers to free items within block
void * block
data storage area
Glib::Threads::Mutex m_lock
LIBPBD_API Transmitter warning
guint write_space() const
std::ostream & endmsg(std::ostream &ostr)
guint read(T *dest, guint cnt)
guint pending_size() const
virtual void release(void *)
virtual void release(void *)
static void free_per_thread_pool(void *ptr)
CrossThreadPool * per_thread_pool(bool must_exist=true)
Pool(std::string name, unsigned long item_size, unsigned long nitems)
~SingleAllocMultiReleasePool()
RingBuffer< void * > pending
#define DEBUG_TRACE(bits, str)
PerThreadPool * parent() const
SingleAllocMultiReleasePool(std::string name, unsigned long item_size, unsigned long nitems)
guint write(T const *src, guint cnt)
RingBuffer< CrossThreadPool * > * _trash
MultiAllocSingleReleasePool(std::string name, unsigned long item_size, unsigned long nitems)
void create_per_thread_pool(std::string name, unsigned long item_size, unsigned long nitems)
void set_trash(RingBuffer< CrossThreadPool * > *t)
Glib::Threads::Private< CrossThreadPool > _key
Glib::Threads::Mutex _trash_mutex
virtual void release(void *)
Glib::Threads::Mutex m_lock
void flush_pending_with_ev(void *)
std::string string_compose(const std::string &fmt, const T1 &o1)
CrossThreadPool(std::string n, unsigned long isize, unsigned long nitems, PerThreadPool *)
void add_to_trash(CrossThreadPool *)