Changed fill-column to 80, so more space for comments.

This commit is contained in:
2024-06-28 16:11:01 +01:00
parent 3a09beb582
commit 6014620baa
8 changed files with 92 additions and 112 deletions

View File

@@ -26,8 +26,8 @@
/**
@brief Some fixed portion of bytes allocated on the heap.
@details A fixed allocation of bytes. Cannot be resized nor can it
be stack allocated (the usual way) due to flexible array attached.
@details A fixed allocation of bytes. Cannot be resized nor can it be stack
allocated (the usual way) due to flexible array attached.
@prop[next] Next page in the linked list
@prop[available] Available number of bytes in page
@@ -42,9 +42,8 @@ typedef struct Page
/**
@brief Allocate a new page on the heap with the given properties.
@details Allocates a new page using malloc with the given size and
pointer to next page. NOTE: all memory is 0 initialised by
default.
@details Allocates a new page using malloc with the given size and pointer to
next page. NOTE: all memory is 0 initialised by default.
@param[max] Maximum available memory in page
*/
@@ -53,9 +52,8 @@ page_t *page_create(size_t max);
/**
@brief Delete a page, freeing its memory
@details Free's the memory associated with the page via free().
NOTE: any pointers to the page's memory are considered invalid once
this is called.
@details Free's the memory associated with the page via free(). NOTE: any
pointers to the page's memory are considered invalid once this is called.
@param[page] Page to delete
*/
@@ -65,8 +63,8 @@ void page_delete(page_t *page);
@brief A collection of pages through which generic allocations can
occur.
@details Collection of pages maintained through a vector of
pointers to pages.
@details Collection of pages maintained through a vector of pointers to
pages.
@prop[page_vec] Vector of pages
*/
@@ -80,9 +78,8 @@ typedef struct
/**
@brief Instantiate a new heap structure
@details Initialises the heap structure given. No heap allocation
occurs here until a new page is created, so this may be called
safely.
@details Initialises the heap structure given. No heap allocation occurs
here until a new page is created, so this may be called safely.
@param[heap] Pointer to heap to initialise
*/
@@ -91,8 +88,8 @@ void heap_create(heap_t *heap);
/**
@brief Allocate a new page on the heap
@details Creates and joins a new page onto the linked list
maintained by the heap. heap.end is set to this new page.
@details Creates and joins a new page onto the linked list maintained by the
heap. heap.end is set to this new page.
@param[heap] Heap to create a new page on
@param[size] Size of page to allocate
@@ -104,10 +101,9 @@ page_t *heap_allocate(heap_t *heap, size_t size);
/**
@brief Free a page of memory from the heap
@details The page given is removed from the linked list of pages
then freed from the heap via page_delete(). If the page does not
belong to this heap (O(heap.pages) time) then false is returned,
otherwise true.
@details The page given is removed from the linked list of pages then freed
from the heap via page_delete(). If the page does not belong to this heap
(O(heap.pages) time) then false is returned, otherwise true.
@param[heap] Heap to free page from
@param[page] Page to delete