NO-OP: clang-format
This commit is contained in:
parent
a8a4695466
commit
8418e7c954
|
@ -22,8 +22,8 @@
|
|||
#ifndef __qm_pool_h__
|
||||
#define __qm_pool_h__
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <glibmm/threads.h>
|
||||
|
||||
|
@ -44,13 +44,24 @@ class LIBPBD_API Pool
|
|||
virtual void* alloc ();
|
||||
virtual void release (void*);
|
||||
|
||||
std::string name() const { return _name; }
|
||||
guint available() const { return free_list.read_space(); }
|
||||
guint used() const { return free_list.bufsize() - available(); }
|
||||
guint total() const { return free_list.bufsize(); }
|
||||
std::string name () const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
guint available () const
|
||||
{
|
||||
return free_list.read_space ();
|
||||
}
|
||||
guint used () const
|
||||
{
|
||||
return free_list.bufsize () - available ();
|
||||
}
|
||||
guint total () const
|
||||
{
|
||||
return free_list.bufsize ();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
PBD::RingBuffer<void*> free_list; ///< a list of pointers to free items within block
|
||||
|
||||
std::string _name;
|
||||
|
@ -76,7 +87,6 @@ class LIBPBD_API SingleAllocMultiReleasePool : public Pool
|
|||
Glib::Threads::Mutex m_lock;
|
||||
};
|
||||
|
||||
|
||||
class LIBPBD_API MultiAllocSingleReleasePool : public Pool
|
||||
{
|
||||
public:
|
||||
|
@ -112,12 +122,16 @@ class LIBPBD_API CrossThreadPool : public Pool
|
|||
void* alloc ();
|
||||
void push (void*);
|
||||
|
||||
PerThreadPool* parent () const {
|
||||
PerThreadPool* parent () const
|
||||
{
|
||||
return _parent;
|
||||
}
|
||||
|
||||
bool empty ();
|
||||
guint pending_size() const { return pending.read_space(); }
|
||||
guint pending_size () const
|
||||
{
|
||||
return pending.read_space ();
|
||||
}
|
||||
|
||||
void flush_pending ();
|
||||
void flush_pending_with_ev (void*);
|
||||
|
@ -135,11 +149,15 @@ class LIBPBD_API PerThreadPool
|
|||
public:
|
||||
PerThreadPool ();
|
||||
|
||||
const Glib::Threads::Private<CrossThreadPool>& key() const { return _key; }
|
||||
const Glib::Threads::Private<CrossThreadPool>& key () const
|
||||
{
|
||||
return _key;
|
||||
}
|
||||
|
||||
void create_per_thread_pool (std::string name, unsigned long item_size, unsigned long nitems, PoolDumpCallback cb = NULL);
|
||||
|
||||
CrossThreadPool* per_thread_pool (bool must_exist = true);
|
||||
|
||||
bool has_per_thread_pool ();
|
||||
void set_trash (PBD::RingBuffer<CrossThreadPool*>* t);
|
||||
void add_to_trash (CrossThreadPool*);
|
||||
|
|
|
@ -20,17 +20,16 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "pbd/compose.h"
|
||||
#include "pbd/debug.h"
|
||||
#include "pbd/error.h"
|
||||
#include "pbd/pool.h"
|
||||
#include "pbd/pthread_utils.h"
|
||||
#include "pbd/error.h"
|
||||
#include "pbd/debug.h"
|
||||
#include "pbd/compose.h"
|
||||
#include "pbd/stacktrace.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -134,10 +133,8 @@ SingleAllocMultiReleasePool::~SingleAllocMultiReleasePool ()
|
|||
void*
|
||||
MultiAllocSingleReleasePool::alloc ()
|
||||
{
|
||||
void *ptr;
|
||||
Glib::Threads::Mutex::Lock guard (m_lock);
|
||||
ptr = Pool::alloc ();
|
||||
return ptr;
|
||||
return Pool::alloc ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -215,7 +212,6 @@ PerThreadPool::has_per_thread_pool ()
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/** @return CrossThreadPool for the current thread, which must previously have been created by
|
||||
* calling create_per_thread_pool in the current thread.
|
||||
*/
|
||||
|
@ -260,7 +256,6 @@ CrossThreadPool::CrossThreadPool (string n, unsigned long isize, unsigned long
|
|||
, pending (nitems)
|
||||
, _parent (p)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -311,4 +306,3 @@ CrossThreadPool::empty ()
|
|||
{
|
||||
return (free_list.write_space () == pending.read_space ());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user