|
| bool | avail (void) const |
| | Check whether there are objects available to be allocated.
|
| ReusableObject * | get (void) |
| | Request a reusable object from the free list or mapped space.
|
| ReusableObject * | getLocked (void) |
| | Used to get an object from the reuse pool when the mutex lock is already held.
|
| ReusableObject * | getTimed (timeout_t timeout) |
| | Request a reusable object from the free list or mapped space.
|
| | MappedReuse (const char *name, size_t size, unsigned count) |
| | Construct a named memory segment for use with managed fixed size reusable objects.
|
| void | removeLocked (ReusableObject *object) |
| | Used to return an object to the reuse pool when the mutex lock is already held.
|
| ReusableObject * | request (void) |
| | Request a reusable object from the free list or mapped space.
|
|
| void | create (const char *fname, unsigned count) |
|
| MappedReuse (size_t osize) |
| ReusableObject * | next (ReusableObject *object) |
| | Get next reusable object in the pool.
|
| void | release (ReusableObject *object) |
| | Release resuable object.
|
| | ReusableAllocator () |
| | Initialize reusable allocator through a conditional.
|
| void | broadcast (void) |
| | Signal the conditional to release all waiting threads.
|
|
| Conditional () |
| | Initialize and construct conditional.
|
| void | signal (void) |
| | Signal the conditional to release one waiting thread.
|
| bool | wait (struct timespec *timeout) |
| | Conditional wait for signal on timespec timeout.
|
| bool | wait (timeout_t timeout) |
| | Conditional wait for signal on millisecond timeout.
|
| void | wait (void) |
| | Wait (block) until signalled.
|
|
| ~Conditional () |
| | Destroy conditional, release any blocked threads.
|
|
| ConditionMutex () |
| | Initialize and construct conditional.
|
| void | lock (void) |
| | Lock the conditional's supporting mutex.
|
| void | unlock (void) |
| | Unlock the conditional's supporting mutex.
|
|
| ~ConditionMutex () |
| | Destroy conditional, release any blocked threads.
|
| void | create (const char *name, size_t size=(size_t) 0) |
| | Supporting function to construct a new or access an existing shared memory segment.
|
| caddr_t | addr (void) |
| | Get starting address of mapped segment.
|
| bool | copy (size_t offset, void *buffer, size_t size) const |
| | Copy memory from specific offset within the mapped memory segment.
|
| size_t | len (void) const |
| | Get size of mapped segment.
|
| | MappedMemory (const char *name) |
| | Provide read-only mapped access to an existing named shared memory segment.
|
| | MappedMemory (const char *name, size_t size) |
| | Construct a read/write access mapped shared segment of memory of a known size.
|
| void * | offset (size_t offset) const |
| | Get memory from a specific offset within the mapped memory segment.
|
| | operator bool () const |
| | Test if map active.
|
| bool | operator! () const |
| | Test if map is inactive.
|
|
void | release (void) |
| | Unmap memory segment.
|
| void * | sbrk (size_t size) |
| | Extend size of managed heap on shared memory segment.
|
|
virtual | ~MappedMemory () |
| | Unmap memory segment.
|
Map a reusable allocator over a named shared memory segment.
This may be used to form a resource bound fixed size managed heap in shared memory. The request can either be fulfilled from the object reuse pool or from a new section of memory, and if all memory in the segment has been exhausted, it can wait until more objects are returned by another thread to the reuse pool.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 191 of file mapped.h.