summaryrefslogtreecommitdiffstats
path: root/src/core/malloc.c
diff options
context:
space:
mode:
authorHolger Lubitz2007-07-23 17:48:39 +0200
committerHolger Lubitz2007-08-02 22:42:45 +0200
commit373022108ba389fb3d50a3d50f9baf64c6c82171 (patch)
tree8d7731fa7a0812a379bd9f69e901478182c7eb89 /src/core/malloc.c
parentError message cleanups. (diff)
downloadipxe-373022108ba389fb3d50a3d50f9baf64c6c82171.tar.gz
ipxe-373022108ba389fb3d50a3d50f9baf64c6c82171.tar.xz
ipxe-373022108ba389fb3d50a3d50f9baf64c6c82171.zip
malloc attribute changes
Diffstat (limited to 'src/core/malloc.c')
-rw-r--r--src/core/malloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/malloc.c b/src/core/malloc.c
index 2d892f42..6b8add94 100644
--- a/src/core/malloc.c
+++ b/src/core/malloc.c
@@ -95,6 +95,7 @@ static char heap[HEAP_SIZE] __attribute__ (( aligned ( __alignof__(void *) )));
*
* @c align must be a power of two. @c size may not be zero.
*/
+__attribute__ ((malloc))
void * alloc_memblock ( size_t size, size_t align ) {
struct memory_block *block;
size_t align_mask;
@@ -248,6 +249,7 @@ void free_memblock ( void *ptr, size_t size ) {
* Calling realloc() with a new size of zero is a valid way to free a
* memory block.
*/
+__attribute__ ((malloc))
void * realloc ( void *old_ptr, size_t new_size ) {
struct autosized_block *old_block;
struct autosized_block *new_block;
@@ -297,6 +299,7 @@ void * realloc ( void *old_ptr, size_t new_size ) {
* Allocates memory with no particular alignment requirement. @c ptr
* will be aligned to at least a multiple of sizeof(void*).
*/
+__attribute__ ((malloc))
void * malloc ( size_t size ) {
return realloc ( NULL, size );
}
@@ -326,6 +329,7 @@ void free ( void *ptr ) {
* This function name is non-standard, but pretty intuitive.
* zalloc(size) is always equivalent to calloc(1,size)
*/
+__attribute__ ((malloc))
void * zalloc ( size_t size ) {
void *data;