Buffered pager for storing paged strings for character protocol.
More...
#include <memory.h>
Public Member Functions |
| bufpager (size_t page=0) |
unsigned long | getUsed (void) |
| Get total size.
|
void | reset (void) |
| Reset pager text buffer protocol.
|
void | rewind (void) |
| Rewind to start of text buffer protocol.
|
unsigned | getAlloc (void) |
| Get the size of a memory page.
|
unsigned | getLimit (void) |
| Get the maximum number of pages that are permitted.
|
unsigned | getPages (void) |
| Get the number of pages that have been allocated from the real heap.
|
| memalloc (size_t page=0) |
| Construct a memory pager.
|
void | purge (void) |
| Purge all allocated memory and heap pages immediately.
|
unsigned | utilization (void) |
| Determine fragmentation level of acquired heap pages.
|
virtual | ~memalloc () |
| Destroy a memory pager.
|
void * | alloc (size_t size) |
| Convenience function.
|
char * | dup (const char *string) |
| Duplicate NULL terminated string into allocated memory.
|
void * | dup (void *memory, size_t size) |
| Duplicate existing memory block into allocated memory.
|
void * | zalloc (size_t size) |
| Allocate memory from the pager heap.
|
int | get (void) |
| Get the next character.
|
int | put (int code) |
| Put the next character.
|
Protected Member Functions |
virtual void * | _alloc (size_t size) |
| Allocate memory from the pager heap.
|
page_t * | pager (void) |
| Acquire a new page from the heap.
|
virtual void * | _alloc (size_t size)=0 |
| Protocol to allocate memory from the pager heap.
|
virtual void | _lock (void) |
virtual void | _unlock (void) |
virtual int | _getch (void)=0 |
| Get the next character.
|
virtual int | _putch (int code)=0 |
| Put the next character.
|
Additional Inherited Members |
unsigned | limit |
Detailed Description
Buffered pager for storing paged strings for character protocol.
- Author
- David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org
Definition at line 413 of file memory.h.
Member Function Documentation
virtual void* ucommon::bufpager::_alloc |
( |
size_t |
size | ) |
|
|
protectedvirtual |
Allocate memory from the pager heap.
The size of the request must be less than the size of the memory page used. This implements the memory protocol allocation method.
- Parameters
-
- Returns
- allocated memory or NULL if not possible.
Reimplemented from ucommon::memalloc.
unsigned long ucommon::bufpager::getUsed |
( |
void |
| ) |
|
|
inline |
Get total size.
- Returns
- number of characters in buffer.
Definition at line 447 of file memory.h.
The documentation for this class was generated from the following file: