/* * include/alloc.h * * Primary header for liballoc API * CISC 301 -- Operating Systems, Project 3 * * Copyright (C) 2025 Douglas B. Rumbaugh * * Distributed under the Modified BSD License * */ #ifndef H_LIBALLOC #define H_LIBALLOC #include #include #include #include "constants.h" #include "free_list.h" /* * Returns a pointer to a new region of memory of the specified * size, or NULL if no memory is available. Requests for 0 bytes of * memory will also return NULL. */ void *allocate(size_t); /* * Release a block of memory previous allocated using allocate(). If the * input pointer was not returned by allocate(), then the behavior of * this function is undefined. * * Accessing a pointer that has been previous passed to this function is * undefined behavior. */ void release(void *); /* * Return a pointer to the head of the free list. I can't recall * precisely what I wanted this function called in the assignment, * so this name may change when I get the chance to check. */ free_nd *free_list_head(); #endif