Menu

overview

Mark Hobley

== Overview ==

The libbuffers library provides support for dynamically allocated buffers. Because buffers can be allocated dynamically, a table, known as the [buffer information table], is allocated in [dynamic memory]. The [buffer information table] can be resized to accomodate additional buffers as required. A [master record] is required to track the size and allocation address of the buffer information table.

== Chunky allocation ==

The libbuffers library uses a [chunky dynamic allocation] technique. This reduces operational overhead, because buffers and tables are not being constantly resized as the library is utilized.

== Initialization ==

The [initbuffers] function provides initialization code that must be run in order to utilize the libbuffers library. The [initbuffers] function creates the [buffer information table] in [dynamic memory] and updates the [master record] with appropriate information.

== Operation ==

The [allocateabuffer] function will dynamically allocate a buffer in memory, making appropriate entries in the [buffer information table].

== Complications ==

The library uses a dynamically allocated [buffer information table]. Because these can be moved around in memory as they become resized, it is not possible for these to hold record locking information directly, because [rwlocks] become broken as the tables are moved. To work around this, instead of the record locking information being stored directly in the [buffer information table], the record locks are separately allocated into [dynamic memory], and the [buffer information table] holds a pointer to the record locking information. This way, when the table is moved, the record locking information remains undisturbed.