diff options
author | eb <eb@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-04-30 03:52:31 +0000 |
---|---|---|
committer | eb <eb@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-04-30 03:52:31 +0000 |
commit | 9d1423b9506c89a51a10b6119d01ce9a82a13b0c (patch) | |
tree | 186e1b20618bf805dd262572bd3b2778b767d201 /pmt/src/lib/pmt_pool.h | |
parent | 7f202514385708941073930bc6d9a5237bb89826 (diff) |
Merged features/inband-usb -r6431:8293 into trunk.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8295 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'pmt/src/lib/pmt_pool.h')
-rw-r--r-- | pmt/src/lib/pmt_pool.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pmt/src/lib/pmt_pool.h b/pmt/src/lib/pmt_pool.h index ac0c07bb61..42276a14f0 100644 --- a/pmt/src/lib/pmt_pool.h +++ b/pmt/src/lib/pmt_pool.h @@ -38,10 +38,13 @@ class pmt_pool { }; omni_mutex d_mutex; + omni_condition d_cond; size_t d_itemsize; size_t d_alignment; size_t d_allocation_size; + size_t d_max_items; + size_t d_n_items; item *d_freelist; std::vector<char *> d_allocations; @@ -50,8 +53,11 @@ public: * \param itemsize size in bytes of the items to be allocated. * \param alignment alignment in bytes of all objects to be allocated (must be power-of-2). * \param allocation_size number of bytes to allocate at a time from the underlying allocator. + * \param max_items is the maximum number of items to allocate. If this number is exceeded, + * the allocate blocks. 0 implies no limit. */ - pmt_pool(size_t itemsize, size_t alignment = 16, size_t allocation_size = 4096); + pmt_pool(size_t itemsize, size_t alignment = 16, + size_t allocation_size = 4096, size_t max_items = 0); ~pmt_pool(); void *malloc(); |