Added a PAGE_DEFAULT_SIZE so max can be set to 0
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
|
||||
page_t *page_create(size_t max, page_t *next)
|
||||
{
|
||||
if (max == 0)
|
||||
max = PAGE_DEFAULT_SIZE;
|
||||
|
||||
page_t *page = calloc(1, sizeof(*page) + max);
|
||||
page->available = max;
|
||||
page->next = next;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define PAGE_DEFAULT_SIZE 256
|
||||
|
||||
typedef struct Page
|
||||
{
|
||||
struct Page *next;
|
||||
|
||||
Reference in New Issue
Block a user