2020-03-21 14:12:26 +01:00
|
|
|
#ifndef __CLOVER_STDLIB_H__
|
|
|
|
#define __CLOVER_STDLIB_H__
|
|
|
|
|
2020-09-07 00:19:48 +02:00
|
|
|
#ifdef __cplusplus
|
2020-03-21 14:12:26 +01:00
|
|
|
extern "C" {
|
2020-09-07 00:19:48 +02:00
|
|
|
#endif
|
|
|
|
|
2020-03-21 14:12:26 +01:00
|
|
|
#include <Library/MemoryAllocationLib.h>
|
2020-09-07 00:19:48 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2020-03-21 14:12:26 +01:00
|
|
|
}
|
2020-09-07 00:19:48 +02:00
|
|
|
#endif
|
2020-03-21 14:12:26 +01:00
|
|
|
|
|
|
|
#include "stddef.h" // for size_t
|
|
|
|
|
2020-03-13 14:11:58 +01:00
|
|
|
void abort(void);
|
2020-03-21 14:12:26 +01:00
|
|
|
|
|
|
|
inline void* malloc(size_t size)
|
|
|
|
{
|
|
|
|
return AllocatePool(size);
|
|
|
|
}
|
|
|
|
|
2020-09-07 00:19:48 +02:00
|
|
|
inline void* reallocWithOldSize(void *ptr, size_t newsize, size_t oldsize) // not the posix realloc. For EFI we need oldsize
|
2020-03-21 14:12:26 +01:00
|
|
|
{
|
|
|
|
return ReallocatePool(oldsize, newsize, ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void free(void *ptr)
|
|
|
|
{
|
|
|
|
FreePool(ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|