00001 /* 00002 * $Id: Memory.h 562 2007-12-02 08:04:16Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_MEMORY_H__ 00015 #define __XVR2_MEMORY_H__ 00016 #include<xvr2/System.h> 00017 #include<xvr2/CoreExceptions.h> 00018 #include<xvr2/Buffer.h> 00019 00020 namespace xvr2{ 00023 class Memory:public System{ 00024 public: 00030 Memory(); 00031 ~Memory(); 00034 static void *allocBuffer(UInt32 size); 00035 static Buffer alloc(UInt32 size); 00039 static void *reallocBuffer(void *buf, UInt32 newsize); 00046 static void freeBuffer(void **buf); 00051 static void clearBuffer(void *buf, UInt32 siz, UInt8 value = 0); 00055 static void *duplicate(const void *buf, UInt32 siz); 00058 static void copy(void *destination, const void *source, UInt32 siz); 00059 }; 00060 } 00061 00062 #endif