|
@@ -95,6 +95,7 @@ static char heap[HEAP_SIZE] __attribute__ (( aligned ( __alignof__(void *) )));
|
95
|
95
|
*
|
96
|
96
|
* @c align must be a power of two. @c size may not be zero.
|
97
|
97
|
*/
|
|
98
|
+__attribute__ ((malloc))
|
98
|
99
|
void * alloc_memblock ( size_t size, size_t align ) {
|
99
|
100
|
struct memory_block *block;
|
100
|
101
|
size_t align_mask;
|
|
@@ -248,6 +249,7 @@ void free_memblock ( void *ptr, size_t size ) {
|
248
|
249
|
* Calling realloc() with a new size of zero is a valid way to free a
|
249
|
250
|
* memory block.
|
250
|
251
|
*/
|
|
252
|
+__attribute__ ((malloc))
|
251
|
253
|
void * realloc ( void *old_ptr, size_t new_size ) {
|
252
|
254
|
struct autosized_block *old_block;
|
253
|
255
|
struct autosized_block *new_block;
|
|
@@ -297,6 +299,7 @@ void * realloc ( void *old_ptr, size_t new_size ) {
|
297
|
299
|
* Allocates memory with no particular alignment requirement. @c ptr
|
298
|
300
|
* will be aligned to at least a multiple of sizeof(void*).
|
299
|
301
|
*/
|
|
302
|
+__attribute__ ((malloc))
|
300
|
303
|
void * malloc ( size_t size ) {
|
301
|
304
|
return realloc ( NULL, size );
|
302
|
305
|
}
|
|
@@ -326,6 +329,7 @@ void free ( void *ptr ) {
|
326
|
329
|
* This function name is non-standard, but pretty intuitive.
|
327
|
330
|
* zalloc(size) is always equivalent to calloc(1,size)
|
328
|
331
|
*/
|
|
332
|
+__attribute__ ((malloc))
|
329
|
333
|
void * zalloc ( size_t size ) {
|
330
|
334
|
void *data;
|
331
|
335
|
|