Add realloc, since the load buffer code requires it.

This commit is contained in:
Michael Brown
2005-05-13 13:20:16 +00:00
parent 59a1662978
commit 5c8ea0b93a
2 changed files with 84 additions and 24 deletions

View File

@@ -12,14 +12,6 @@
*/
extern void * emalloc ( size_t size, unsigned int align );
/*
* Allocate a block, with no particular alignment requirements.
*
*/
static inline void * malloc ( size_t size ) {
return emalloc ( size, sizeof ( void * ) );
}
/*
* Allocate all remaining space on the heap
*
@@ -36,10 +28,6 @@ extern void * emalloc_all ( size_t *size );
*/
extern void efree ( void *ptr );
static inline void free ( void *ptr ) {
efree ( ptr );
}
/*
* Free all allocated blocks on the heap
*
@@ -54,9 +42,22 @@ extern void efree_all ( void );
* corruption will occur.
*
*/
static inline void * erealloc ( void *ptr, size_t size, unsigned int align ) {
extern void * erealloc ( void *ptr, size_t size );
/*
* Allocate, free, and resize blocks without caring about alignment
*
*/
static inline void * malloc ( size_t size ) {
return emalloc ( size, sizeof ( void * ) );
}
static inline void free ( void *ptr ) {
efree ( ptr );
return emalloc ( size, align );
}
static inline void * realloc ( void *ptr, size_t size ) {
return erealloc ( ptr, size );
}
/*