2020-02-23 12:21:28 +01:00
|
|
|
#ifndef __XTOOLSCOMMON_H__
|
|
|
|
#define __XTOOLSCOMMON_H__
|
|
|
|
|
2020-02-23 21:23:31 +01:00
|
|
|
#include <Platform.h>
|
|
|
|
|
2020-02-23 12:21:28 +01:00
|
|
|
#define xsize UINTN
|
|
|
|
#define MAX_XSIZE MAX_UINTN
|
|
|
|
|
|
|
|
extern xsize XArrayGrowByDefault;
|
|
|
|
extern xsize XBufferGrowByDefault;
|
|
|
|
|
|
|
|
/* For convience, operator [] is define with int parameter.
|
|
|
|
* Defining __XTOOLS_INT_CHECK__ make a check that the parameter is >= 0
|
|
|
|
*/
|
|
|
|
#define __XTOOLS_INT_CHECK__
|
|
|
|
|
|
|
|
#define Xalloc(AllocationSize) AllocatePool(AllocationSize)
|
|
|
|
#define Xrealloc(OldSize, NewSize, OldBuffer) ReallocatePool(OldSize, NewSize, OldBuffer)
|
|
|
|
#define Xfree(Buffer) FreePool(Buffer)
|
2020-02-23 21:23:31 +01:00
|
|
|
#define Xmemmove(dest,source,count) CopyMem(dest, (void*)(source), count) // that has to handle overlapping memory (prefer memmove to memcpy).
|
2020-02-23 12:21:28 +01:00
|
|
|
#endif
|