From effc209070f01c4b56014f54161b8f545e2a1ad6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 7 Jul 2022 05:07:11 +0200 Subject: [PATCH] Place Pool in PBD namespace A public class named "Pool" in the global namespace just calls for symbol name conflicts. --- gtk2_ardour/midi_tracer.h | 2 +- libs/ardour/ardour/butler.h | 6 +++--- libs/ardour/ardour/click.h | 2 +- libs/ardour/ardour/session_event.h | 6 +++--- libs/ardour/ardour/transport_fsm.h | 4 ++-- libs/ardour/ardour/triggerbox.h | 4 ++-- libs/pbd/pbd/pool.h | 4 ++++ 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/midi_tracer.h b/gtk2_ardour/midi_tracer.h index a3ffb5abbf..854f2f60e5 100644 --- a/gtk2_ardour/midi_tracer.h +++ b/gtk2_ardour/midi_tracer.h @@ -73,7 +73,7 @@ private: GATOMIC_QUAL gint _update_queued; PBD::RingBuffer fifo; - Pool buffer_pool; + PBD::Pool buffer_pool; static const size_t buffer_size = 256; void tracer (MIDI::Parser&, MIDI::byte*, size_t, MIDI::samplecnt_t); diff --git a/libs/ardour/ardour/butler.h b/libs/ardour/ardour/butler.h index 67e9818b6f..aaa30e45d6 100644 --- a/libs/ardour/ardour/butler.h +++ b/libs/ardour/ardour/butler.h @@ -114,9 +114,9 @@ private: samplecnt_t _audio_playback_buffer_size; uint32_t _midi_buffer_size; - PBD::RingBuffer pool_trash; - CrossThreadChannel _xthread; - PBD::MPMCQueue > _delegated_work; + PBD::RingBuffer pool_trash; + CrossThreadChannel _xthread; + PBD::MPMCQueue > _delegated_work; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/click.h b/libs/ardour/ardour/click.h index 00a6d4ef8d..3af2f16e34 100644 --- a/libs/ardour/ardour/click.h +++ b/libs/ardour/ardour/click.h @@ -48,7 +48,7 @@ public: } private: - static Pool pool; + static PBD::Pool pool; }; class LIBARDOUR_API ClickIO : public IO diff --git a/libs/ardour/ardour/session_event.h b/libs/ardour/ardour/session_event.h index 99473e437c..6da44f7e72 100644 --- a/libs/ardour/ardour/session_event.h +++ b/libs/ardour/ardour/session_event.h @@ -150,11 +150,11 @@ public: static void init_event_pool (); static guint pool_available (); - CrossThreadPool* event_pool() const { return own_pool; } + PBD::CrossThreadPool* event_pool() const { return own_pool; } private: - static PerThreadPool* pool; - CrossThreadPool* own_pool; + static PBD::PerThreadPool* pool; + PBD::CrossThreadPool* own_pool; friend class Butler; }; diff --git a/libs/ardour/ardour/transport_fsm.h b/libs/ardour/ardour/transport_fsm.h index 482a200791..946b78070c 100644 --- a/libs/ardour/ardour/transport_fsm.h +++ b/libs/ardour/ardour/transport_fsm.h @@ -105,8 +105,8 @@ struct TransportFSM static void init_pool (); - private: - static Pool* pool; + private: + static PBD::Pool* pool; }; diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 3adee3de7b..a4e505faba 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -670,7 +670,7 @@ class LIBARDOUR_API TriggerBoxThread void* operator new (size_t); void operator delete (void* ptr, size_t); - static MultiAllocSingleReleasePool* pool; + static PBD::MultiAllocSingleReleasePool* pool; static void init_pool (); }; @@ -875,7 +875,7 @@ class LIBARDOUR_API TriggerBox : public Processor Request (Type t) : type (t) {} - static MultiAllocSingleReleasePool* pool; + static PBD::MultiAllocSingleReleasePool* pool; static void init_pool(); void* operator new (size_t); diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h index 3c403d91b8..1d21b1942c 100644 --- a/libs/pbd/pbd/pool.h +++ b/libs/pbd/pbd/pool.h @@ -30,6 +30,8 @@ #include "pbd/libpbd_visibility.h" #include "pbd/ringbuffer.h" +namespace PBD { + typedef void (*PoolDumpCallback) (size_t, void*); /** A pool of data items that can be allocated, read from and written to @@ -171,4 +173,6 @@ private: PBD::RingBuffer* _trash; }; +} // namespace PBD + #endif // __qm_pool_h__