SYS/SYS_Memory.h File Reference

#include "SYS_API.h"
#include <stdlib.h>
#include "SYS_Types.h"
#include "SYS_Align.h"
#include "SYS_AtomicInt.h"
#include "SYS_AtomicIntImpl.h"

Go to the source code of this file.

Classes

class  SYS_MemoryUser
class  SYS_MemoryTable
class  SYS_Memory

Defines

#define SYS_MEMORY_SUBCLASS(STATIC, prefix, table)
#define SYS_MEMPRINTSIZE   32

Functions

SYS_API void SYSprintMemory (char buf[SYS_MEMPRINTSIZE], int64 memory, int field_width=-1)


Define Documentation

#define SYS_MEMORY_SUBCLASS ( STATIC,
prefix,
table   ) 

Value:

STATIC void *prefix##Malloc(int i, size_t amount) \
                         { return SYS_Memory::Malloc(table, i, amount); } \
            STATIC void *prefix##Calloc(int i, size_t amount) \
                         { return SYS_Memory::Calloc(table, i, amount); } \
            STATIC void *prefix##Realloc(int i, void *m, size_t o, size_t n) \
                         { return SYS_Memory::Realloc(table, i, m, o, n); } \
            STATIC void  prefix##Free(int i, void *m, size_t amount) \
                         { SYS_Memory::Free(table, i, m, amount); } \
            STATIC void  prefix##acquire(int i, size_t amount) \
                         { SYS_Memory::acquire(table, i, amount); } \
            STATIC void  prefix##release(int i, size_t amount) \
                         { SYS_Memory::release(table, i, amount); } \
            static inline SYS_MemoryTable &prefix##getTable() { return table; }
When implementing in a different library, the following macro can be used to implement a localized interface. For example, we might have SYS_MEMORY_SUBCLASS(, GU, theGUMemoryTable) or class GU_Memory { public: SYS_MEMORY_SUBCLASS(static, GU, myMemoryTable) private: static SYS_MemoryTable myMemoryTable; };

Definition at line 249 of file SYS_Memory.h.

#define SYS_MEMPRINTSIZE   32

Convenience function to print memory in a consistent format (i.e. 12.3 KB). To print "18446744073709551616.00 MB" requires 27 characters. There are 5 extra characters for good measure in SYS_MEMPRINTSIZE

Definition at line 268 of file SYS_Memory.h.


Function Documentation

SYS_API void SYSprintMemory ( char  buf[SYS_MEMPRINTSIZE],
int64  memory,
int  field_width = -1 
)


Generated on Thu May 24 00:09:05 2012 for HDK by  doxygen 1.5.9