27 #ifndef _UCOMMON_REUSE_H_
28 #define _UCOMMON_REUSE_H_
30 #ifndef _UCOMMON_THREAD_H_
36 typedef unsigned short vectorsize_t;
49 unsigned count,
limit, used;
56 ArrayReuse(
size_t objsize,
unsigned c,
void *memory);
65 bool avail(
void)
const;
82 unsigned limit, count;
91 bool avail(
void)
const;
129 inline operator bool()
const {
146 return static_cast<T*
>(ArrayReuse::request());
154 inline T*
get(void) {
155 return static_cast<T*
>(ArrayReuse::get());
164 return init<T>(
static_cast<T*
>(ArrayReuse::get()));
173 inline T*
get(timeout_t timeout) {
174 return static_cast<T*
>(ArrayReuse::get(timeout));
184 return init<T>(
static_cast<T*
>(ArrayReuse::get(timeout)));
200 inline operator T*() {
241 inline operator bool()
const {
242 return PagerReuse::avail();
250 return !PagerReuse::avail();
258 inline T *
get(void) {
259 return static_cast<T*
>(PagerReuse::get());
269 return init<T>(
static_cast<T*
>(PagerReuse::get()));
278 inline T *
get(timeout_t timeout) {
279 return static_cast<T*
>(PagerReuse::get(timeout));
290 return init<T>(
static_cast<T*
>(PagerReuse::get(timeout)));
298 return static_cast<T*
>(PagerReuse::request());
323 inline operator T*() {