X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=includes%2Fstdlib.h;h=b94ceafeeeea2fca5a61fe6fde5b11b12f4c2b69;hp=157ebee3c1c95481f0bfc44ccc0c70c967f73622;hb=e921387af8d68b18babcd7e098b97479965b7663;hpb=81b6302395f77a0d4e0771cb9e1cef80188d9474 diff --git a/includes/stdlib.h b/includes/stdlib.h index 157ebee..b94ceaf 100644 --- a/includes/stdlib.h +++ b/includes/stdlib.h @@ -95,19 +95,26 @@ void srand( unsigned int seed ) _PDCLIB_nothrow; /* Memory management functions */ -/* Allocate a chunk of heap memory of given size. If request could not be +/* Allocate a chunk of memory of given size. If request could not be satisfied, return NULL. Otherwise, return a pointer to the allocated memory. Memory contents are undefined. */ void * malloc( size_t size ) _PDCLIB_nothrow; -/* Allocate a chunk of heap memory that is large enough to hold nmemb elements - of the given size, and zero-initialize that memory. If request could not be +/* Allocate a chunk of memory that is large enough to hold nmemb elements of + the given size, and zero-initialize that memory. If request could not be satisfied, return NULL. Otherwise, return a pointer to the allocated memory. */ void * calloc( size_t nmemb, size_t size ) _PDCLIB_nothrow; +/* Allocate a chunk of memory of given size, with specified alignment (which + must be a power of two; if it is not, the next greater power of two is + used). If request could not be satisfied, return NULL. Otherwise, return + a pointer to the allocated memory. +*/ +void * aligned_alloc( size_t alignment, size_t size ) _PDCLIB_nothrow; + /* De-allocate a chunk of heap memory previously allocated using malloc(), calloc(), or realloc(), and pointed to by ptr. If ptr does not match a pointer previously returned by the mentioned allocation functions, or