- renamed namespace (s/pf/gbe) - created first files for the IR
authorBenjamin Segovia <segovia.benjamin@gmail.com>
Sun, 22 Jan 2012 06:58:24 +0000 (06:58 +0000)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:15:08 +0000 (16:15 -0700)
56 files changed:
backend/src/ir/ir_function.cpp [moved from backend/src/ir/instruction.cpp with 96% similarity]
backend/src/ir/ir_function.hpp [new file with mode: 0644]
backend/src/ir/ir_instruction.cpp [new file with mode: 0644]
backend/src/ir/ir_instruction.hpp [new file with mode: 0644]
backend/src/ir/ir_register.cpp [moved from backend/src/ir/instruction.hpp with 96% similarity]
backend/src/ir/ir_register.hpp [new file with mode: 0644]
backend/src/ir/ir_scope.cpp [moved from backend/src/ir/function.hpp with 96% similarity]
backend/src/ir/ir_scope.hpp [new file with mode: 0644]
backend/src/ir/ir_unit.cpp [moved from backend/src/ir/function.cpp with 97% similarity]
backend/src/ir/ir_unit.hpp [new file with mode: 0644]
backend/src/ir/register.cpp [deleted file]
backend/src/ir/register.hpp [deleted file]
backend/src/ir/scope.cpp [deleted file]
backend/src/ir/scope.hpp [deleted file]
backend/src/ir/unit.cpp [deleted file]
backend/src/ir/unit.hpp [deleted file]
backend/src/sys/alloc.cpp
backend/src/sys/alloc.hpp
backend/src/sys/array.hpp
backend/src/sys/atomic.hpp
backend/src/sys/barrier.hpp
backend/src/sys/condition.cpp
backend/src/sys/condition.hpp
backend/src/sys/constants.hpp
backend/src/sys/default_path.cpp
backend/src/sys/default_path.hpp
backend/src/sys/filename.cpp
backend/src/sys/filename.hpp
backend/src/sys/fixed_array.hpp
backend/src/sys/hash_map.hpp
backend/src/sys/intrinsics.hpp
backend/src/sys/library.cpp
backend/src/sys/library.hpp
backend/src/sys/list.hpp
backend/src/sys/logging.cpp
backend/src/sys/logging.hpp
backend/src/sys/map.hpp
backend/src/sys/mutex.cpp
backend/src/sys/mutex.hpp
backend/src/sys/platform.cpp
backend/src/sys/platform.hpp
backend/src/sys/ref.hpp
backend/src/sys/set.hpp
backend/src/sys/string.cpp
backend/src/sys/string.hpp
backend/src/sys/sysinfo.cpp
backend/src/sys/sysinfo.hpp
backend/src/sys/thread.cpp
backend/src/sys/thread.hpp
backend/src/sys/vector.hpp
backend/src/utest/utest.hpp
backend/src/utest/utest_console.cpp
backend/src/utest/utest_font.cpp
backend/src/utest/utest_lua.cpp
backend/src/utest/utest_rt.cpp
backend/src/utest/utest_tasking.cpp

similarity index 96%
rename from backend/src/ir/instruction.cpp
rename to backend/src/ir/ir_function.cpp
index 12001d6..41a3657 100644 (file)
@@ -17,3 +17,5 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
+#include "ir_function.hpp"
+
diff --git a/backend/src/ir/ir_function.hpp b/backend/src/ir/ir_function.hpp
new file mode 100644 (file)
index 0000000..b14ac8a
--- /dev/null
@@ -0,0 +1,24 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#ifndef __GBE_IR_FUNCTION_HPP__
+#define __GBE_IR_FUNCTION_HPP__
+
+#endif /* __GBE_IR_FUNCTION_HPP__ */
+
diff --git a/backend/src/ir/ir_instruction.cpp b/backend/src/ir/ir_instruction.cpp
new file mode 100644 (file)
index 0000000..e17d18d
--- /dev/null
@@ -0,0 +1,21 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#include "ir_instruction.hpp"
+
diff --git a/backend/src/ir/ir_instruction.hpp b/backend/src/ir/ir_instruction.hpp
new file mode 100644 (file)
index 0000000..a82d768
--- /dev/null
@@ -0,0 +1,25 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#ifndef __GBE_IR_INSTRUCTION_HPP__
+#define __GBE_IR_INSTRUCTION_HPP__
+
+#endif /* __GBE_IR_INSTRUCTION_HPP__ */
+
+
similarity index 96%
rename from backend/src/ir/instruction.hpp
rename to backend/src/ir/ir_register.cpp
index 12001d6..3fe49e3 100644 (file)
@@ -17,3 +17,5 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
+#include "ir_register.hpp"
+
diff --git a/backend/src/ir/ir_register.hpp b/backend/src/ir/ir_register.hpp
new file mode 100644 (file)
index 0000000..5825b69
--- /dev/null
@@ -0,0 +1,25 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#ifndef __GBE_IR_REGISTER_HPP__
+#define __GBE_IR_REGISTER_HPP__
+
+#endif /* __GBE_IR_REGISTER_HPP__ */
+
+
similarity index 96%
rename from backend/src/ir/function.hpp
rename to backend/src/ir/ir_scope.cpp
index 12001d6..c8027a4 100644 (file)
@@ -17,3 +17,5 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
+#include "ir_scope.hpp"
+
diff --git a/backend/src/ir/ir_scope.hpp b/backend/src/ir/ir_scope.hpp
new file mode 100644 (file)
index 0000000..a0d27f8
--- /dev/null
@@ -0,0 +1,25 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#ifndef __GBE_IR_SCOPE_HPP__
+#define __GBE_IR_SCOPE_HPP__
+
+#endif /* __GBE_IR_SCOPE_HPP__ */
+
+
similarity index 97%
rename from backend/src/ir/function.cpp
rename to backend/src/ir/ir_unit.cpp
index 12001d6..1ff8523 100644 (file)
@@ -17,3 +17,5 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
+#include "ir_unit.hpp"
+
diff --git a/backend/src/ir/ir_unit.hpp b/backend/src/ir/ir_unit.hpp
new file mode 100644 (file)
index 0000000..ba6d711
--- /dev/null
@@ -0,0 +1,25 @@
+/* 
+ * Copyright © 2012 Intel Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Author: Benjamin Segovia <benjamin.segovia@intel.com>
+ */
+
+#ifndef __GBE_IR_UNIT_HPP__
+#define __GBE_IR_UNIT_HPP__
+
+#endif /* __GBE_IR_UNIT_HPP__ */
+
+
diff --git a/backend/src/ir/register.cpp b/backend/src/ir/register.cpp
deleted file mode 100644 (file)
index 12001d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
- * Copyright © 2012 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Benjamin Segovia <benjamin.segovia@intel.com>
- */
-
diff --git a/backend/src/ir/register.hpp b/backend/src/ir/register.hpp
deleted file mode 100644 (file)
index 12001d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
- * Copyright © 2012 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Benjamin Segovia <benjamin.segovia@intel.com>
- */
-
diff --git a/backend/src/ir/scope.cpp b/backend/src/ir/scope.cpp
deleted file mode 100644 (file)
index 12001d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
- * Copyright © 2012 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Benjamin Segovia <benjamin.segovia@intel.com>
- */
-
diff --git a/backend/src/ir/scope.hpp b/backend/src/ir/scope.hpp
deleted file mode 100644 (file)
index 12001d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
- * Copyright © 2012 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Benjamin Segovia <benjamin.segovia@intel.com>
- */
-
diff --git a/backend/src/ir/unit.cpp b/backend/src/ir/unit.cpp
deleted file mode 100644 (file)
index 12001d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
- * Copyright © 2012 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Benjamin Segovia <benjamin.segovia@intel.com>
- */
-
diff --git a/backend/src/ir/unit.hpp b/backend/src/ir/unit.hpp
deleted file mode 100644 (file)
index 12001d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
- * Copyright © 2012 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author: Benjamin Segovia <benjamin.segovia@intel.com>
- */
-
index e23ae8e..59835f2 100644 (file)
 #include "sys/atomic.hpp"
 #include "sys/mutex.hpp"
 
-#if PF_DEBUG_MEMORY
+#if GBE_DEBUG_MEMORY
 #ifdef __MSVC__
 #include <unordered_map>
 #else
 #include <tr1/unordered_map>
 #endif /* __MSVC__ */
 #include <cstring>
-#endif /* PF_DEBUG_MEMORY */
+#endif /* GBE_DEBUG_MEMORY */
 
 #if defined(__ICC__)
 #include <stdint.h>
 ////////////////////////////////////////////////////////////////////////////////
 /// Memory debugger
 ////////////////////////////////////////////////////////////////////////////////
-namespace pf
+namespace gbe
 {
 
-#if PF_DEBUG_MEMORY
+#if GBE_DEBUG_MEMORY
   /*! Store each allocation data */
   struct AllocData {
     INLINE AllocData(void) {}
@@ -156,10 +156,10 @@ namespace pf
     memDebugger = NULL;
     delete _debug;
   }
-#endif /* PF_DEBUG_MEMORY */
+#endif /* GBE_DEBUG_MEMORY */
 }
 
-namespace pf
+namespace gbe
 {
   void* malloc(size_t size) {
     void *ptr = std::malloc(size);
@@ -168,10 +168,10 @@ namespace pf
   }
 
   void* realloc(void *ptr, size_t size) {
-#if PF_DEBUG_MEMORY
+#if GBE_DEBUG_MEMORY
     if (ptr) MemDebuggerRemoveAlloc(ptr);
-#endif /* PF_DEBUG_MEMORY */
-    PF_ASSERT(size);
+#endif /* GBE_DEBUG_MEMORY */
+    GBE_ASSERT(size);
     if (ptr == NULL) {
       ptr = std::realloc(ptr, size);
       MemDebuggerInitializeMem(ptr, size);
@@ -192,7 +192,7 @@ namespace pf
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-namespace pf
+namespace gbe
 {
   void* alignedMalloc(size_t size, size_t align) {
     void* ptr = _mm_malloc(size,align);
@@ -217,7 +217,7 @@ namespace pf
 #include <malloc.h>
 #include <iostream>
 
-namespace pf
+namespace gbe
 {
   void* alignedMalloc(size_t size, size_t align) {
     void* ptr = memalign(align,size);
@@ -239,7 +239,7 @@ namespace pf
 
 #include <cstdlib>
 
-namespace pf
+namespace gbe
 {
   void* alignedMalloc(size_t size, size_t align) {
     void* mem = malloc(size+(align-1)+sizeof(void*));
@@ -252,7 +252,7 @@ namespace pf
   }
 
   void alignedFree(void* ptr) {
-    PF_ASSERT(ptr);
+    GBE_ASSERT(ptr);
     free(((void**)ptr)[-1]);
   }
 }
index 5b68634..d379354 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_ALLOC_HPP__
-#define __PF_ALLOC_HPP__
+#ifndef __GBE_ALLOC_HPP__
+#define __GBE_ALLOC_HPP__
 
 #include "sys/platform.hpp"
 #include <cstdlib>
 #include <new>
 
-namespace pf
+namespace gbe
 {
   /*! regular allocation */
   void* malloc(size_t size);
@@ -36,7 +36,7 @@ namespace pf
   void  alignedFree(void* ptr);
 
   /*! Monitor memory allocations */
-#if PF_DEBUG_MEMORY
+#if GBE_DEBUG_MEMORY
   void* MemDebuggerInsertAlloc(void*, const char*, const char*, int);
   void  MemDebuggerRemoveAlloc(void *ptr);
   void  MemDebuggerDumpAlloc(void);
@@ -52,7 +52,7 @@ namespace pf
   INLINE void  MemDebuggerEnableMemoryInitialization(bool enabled) {}
   INLINE void  MemDebuggerStart(void) {}
   INLINE void  MemDebuggerEnd(void) {}
-#endif /* PF_DEBUG_MEMORY */
+#endif /* GBE_DEBUG_MEMORY */
 
   /*! Properly handle the allocated type */
   template <typename T>
@@ -60,86 +60,86 @@ namespace pf
     MemDebuggerInsertAlloc(ptr, file, function, line);
     return ptr;
   }
-} /* namespace pf */
+} /* namespace gbe */
 
 /*! Declare a structure with custom allocators */
-#define PF_STRUCT(TYPE)                                      \
+#define GBE_STRUCT(TYPE)                                      \
   void* operator new(size_t size)   {                        \
     if (AlignOf<TYPE>::value > sizeof(uintptr_t))            \
-      return pf::alignedMalloc(size, AlignOf<TYPE>::value);  \
+      return gbe::alignedMalloc(size, AlignOf<TYPE>::value);  \
     else                                                     \
-      return pf::malloc(size);                               \
+      return gbe::malloc(size);                               \
   }                                                          \
   void* operator new[](size_t size)   {                      \
     if (AlignOf<TYPE>::value > sizeof(uintptr_t))            \
-      return pf::alignedMalloc(size, AlignOf<TYPE>::value);  \
+      return gbe::alignedMalloc(size, AlignOf<TYPE>::value);  \
     else                                                     \
-      return pf::malloc(size);                               \
+      return gbe::malloc(size);                               \
   }                                                          \
   void  operator delete(void* ptr) {                         \
     if (AlignOf<TYPE>::value > sizeof(uintptr_t))            \
-      return pf::alignedFree(ptr);                           \
+      return gbe::alignedFree(ptr);                           \
     else                                                     \
-      return pf::free(ptr);                                  \
+      return gbe::free(ptr);                                  \
   }                                                          \
   void  operator delete[](void* ptr) {                       \
     if (AlignOf<TYPE>::value > sizeof(uintptr_t))            \
-      return pf::alignedFree(ptr);                           \
+      return gbe::alignedFree(ptr);                           \
     else                                                     \
-      return pf::free(ptr);                                  \
+      return gbe::free(ptr);                                  \
   }                                                          \
 
 /*! Declare a class with custom allocators */
-#define PF_CLASS(TYPE) \
+#define GBE_CLASS(TYPE) \
 public:                \
-  PF_STRUCT(TYPE)      \
+  GBE_STRUCT(TYPE)      \
 private:
 
 /*! Declare an aligned structure */
-#define PF_ALIGNED_STRUCT(ALIGN)                                              \
-  void* operator new(size_t size)   { return pf::alignedMalloc(size, ALIGN); }\
-  void* operator new[](size_t size) { return pf::alignedMalloc(size, ALIGN); }\
-  void  operator delete(void* ptr)   { pf::alignedFree(ptr); }                \
-  void  operator delete[](void* ptr) { pf::alignedFree(ptr); }
+#define GBE_ALIGNED_STRUCT(ALIGN)                                              \
+  void* operator new(size_t size)   { return gbe::alignedMalloc(size, ALIGN); }\
+  void* operator new[](size_t size) { return gbe::alignedMalloc(size, ALIGN); }\
+  void  operator delete(void* ptr)   { gbe::alignedFree(ptr); }                \
+  void  operator delete[](void* ptr) { gbe::alignedFree(ptr); }
 
 /*! Declare an aligned class */
-#define PF_ALIGNED_CLASS(ALIGN)    \
+#define GBE_ALIGNED_CLASS(ALIGN)    \
 public:                            \
-  PF_ALIGNED_STRUCT(ALIGN)         \
+  GBE_ALIGNED_STRUCT(ALIGN)         \
 private:
 
 /*! Macros to handle allocation position */
-#define PF_NEW(T,...)               \
-  pf::_MemDebuggerInsertAlloc(new T(__VA_ARGS__), __FILE__, __FUNCTION__, __LINE__)
+#define GBE_NEW(T,...)               \
+  gbe::_MemDebuggerInsertAlloc(new T(__VA_ARGS__), __FILE__, __FUNCTION__, __LINE__)
 
-#define PF_NEW_ARRAY(T,N,...)       \
-  pf::_MemDebuggerInsertAlloc(new T[N](__VA_ARGS__), __FILE__, __FUNCTION__, __LINE__)
+#define GBE_NEW_ARRAY(T,N,...)       \
+  gbe::_MemDebuggerInsertAlloc(new T[N](__VA_ARGS__), __FILE__, __FUNCTION__, __LINE__)
 
-#define PF_NEW_P(T,X,...)           \
-  pf::_MemDebuggerInsertAlloc(new (X) T(__VA_ARGS__), __FILE__, __FUNCTION__, __LINE__)
+#define GBE_NEW_P(T,X,...)           \
+  gbe::_MemDebuggerInsertAlloc(new (X) T(__VA_ARGS__), __FILE__, __FUNCTION__, __LINE__)
 
-#define PF_DELETE(X)                \
-  do { pf::MemDebuggerRemoveAlloc(X); delete X; } while (0)
+#define GBE_DELETE(X)                \
+  do { gbe::MemDebuggerRemoveAlloc(X); delete X; } while (0)
 
-#define PF_DELETE_ARRAY(X)          \
-  do { pf::MemDebuggerRemoveAlloc(X); delete[] X; } while (0)
+#define GBE_DELETE_ARRAY(X)          \
+  do { gbe::MemDebuggerRemoveAlloc(X); delete[] X; } while (0)
 
-#define PF_MALLOC(SZ)               \
-  pf::MemDebuggerInsertAlloc(pf::malloc(SZ),__FILE__, __FUNCTION__, __LINE__)
+#define GBE_MALLOC(SZ)               \
+  gbe::MemDebuggerInsertAlloc(gbe::malloc(SZ),__FILE__, __FUNCTION__, __LINE__)
 
-#define PF_REALLOC(PTR, SZ)         \
-  pf::MemDebuggerInsertAlloc(pf::realloc(PTR, SZ),__FILE__, __FUNCTION__, __LINE__)
+#define GBE_REALLOC(PTR, SZ)         \
+  gbe::MemDebuggerInsertAlloc(gbe::realloc(PTR, SZ),__FILE__, __FUNCTION__, __LINE__)
 
-#define PF_FREE(X)                  \
-  do { pf::MemDebuggerRemoveAlloc(X); pf::free(X); } while (0)
+#define GBE_FREE(X)                  \
+  do { gbe::MemDebuggerRemoveAlloc(X); gbe::free(X); } while (0)
 
-#define PF_ALIGNED_FREE(X)          \
-  do { pf::MemDebuggerRemoveAlloc(X); pf::alignedFree(X); } while (0)
+#define GBE_ALIGNED_FREE(X)          \
+  do { gbe::MemDebuggerRemoveAlloc(X); gbe::alignedFree(X); } while (0)
 
-#define PF_ALIGNED_MALLOC(SZ,ALIGN) \
-  pf::MemDebuggerInsertAlloc(pf::alignedMalloc(SZ,ALIGN),__FILE__, __FUNCTION__, __LINE__)
+#define GBE_ALIGNED_MALLOC(SZ,ALIGN) \
+  gbe::MemDebuggerInsertAlloc(gbe::alignedMalloc(SZ,ALIGN),__FILE__, __FUNCTION__, __LINE__)
 
-namespace pf
+namespace gbe
 {
   /*! STL compliant allocator to intercept all memory allocations */
   template<typename T>
@@ -165,15 +165,15 @@ namespace pf
     INLINE const_pointer address(const_reference r) { return &r; }
     INLINE pointer allocate(size_type n, void_allocator_ptr = 0) {
       if (AlignOf<T>::value > sizeof(uintptr_t))
-        return (pointer) PF_ALIGNED_MALLOC(n*sizeof(T), AlignOf<T>::value);
+        return (pointer) GBE_ALIGNED_MALLOC(n*sizeof(T), AlignOf<T>::value);
       else
-        return (pointer) PF_MALLOC(n * sizeof(T));
+        return (pointer) GBE_MALLOC(n * sizeof(T));
     }
     INLINE void deallocate(pointer p, size_type) {
       if (AlignOf<T>::value > sizeof(uintptr_t))
-        PF_ALIGNED_FREE(p);
+        GBE_ALIGNED_FREE(p);
       else
-        PF_FREE(p);
+        GBE_FREE(p);
     }
     INLINE size_type max_size(void) const {
       return std::numeric_limits<size_type>::max() / sizeof(T);
@@ -189,11 +189,11 @@ namespace pf
   class GrowingPool
   {
   public:
-    GrowingPool(void) : current(PF_NEW(GrowingPoolElem, 1)) {}
-    ~GrowingPool(void) { PF_ASSERT(current); PF_DELETE(current); }
+    GrowingPool(void) : current(GBE_NEW(GrowingPoolElem, 1)) {}
+    ~GrowingPool(void) { GBE_ASSERT(current); GBE_DELETE(current); }
     T *allocate(void) {
       if (UNLIKELY(current->allocated == current->maxElemNum)) {
-        GrowingPoolElem *elem = PF_NEW(GrowingPoolElem, 2 * current->maxElemNum);
+        GrowingPoolElem *elem = GBE_NEW(GrowingPoolElem, 2 * current->maxElemNum);
         elem->next = current;
         current = elem;
       }
@@ -206,24 +206,24 @@ namespace pf
     {
       friend class GrowingPool;
       GrowingPoolElem(size_t elemNum) {
-        this->data = PF_NEW_ARRAY(T, elemNum);
+        this->data = GBE_NEW_ARRAY(T, elemNum);
         this->next = NULL;
         this->maxElemNum = elemNum;
         this->allocated = 0;
       }
       ~GrowingPoolElem(void) {
-        PF_ASSERT(this->data);
-        PF_DELETE_ARRAY(this->data);
-        if (this->next) PF_DELETE(this->next);
+        GBE_ASSERT(this->data);
+        GBE_DELETE_ARRAY(this->data);
+        if (this->next) GBE_DELETE(this->next);
       }
       T *data;
       GrowingPoolElem *next;
       size_t allocated, maxElemNum;
     };
     GrowingPoolElem *current;
-    PF_CLASS(GrowingPool);
+    GBE_CLASS(GrowingPool);
   };
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_ALLOC_HPP__ */
+#endif /* __GBE_ALLOC_HPP__ */
 
index 04cc3c6..7b65d67 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_ARRAY_HPP__
-#define __PF_ARRAY_HPP__
+#ifndef __GBE_ARRAY_HPP__
+#define __GBE_ARRAY_HPP__
 
 #include "sys/platform.hpp"
 #include <vector>
 
-namespace pf
+namespace gbe
 {
   /*! Non resizable array with no checking. We make it non-copiable right now
    *  since we do not want to implement an expensive deep copy
@@ -40,7 +40,7 @@ namespace pf
     INLINE array(const array &other) {
       this->elemNum = other.elemNum;
       if (this->elemNum) {
-        this->elem = PF_NEW_ARRAY(T, this->elemNum);
+        this->elem = GBE_NEW_ARRAY(T, this->elemNum);
         for (size_t i = 0; i < this->elemNum; ++i) this->elem[i] = other.elem[i];
       } else
         this->elem = NULL;
@@ -48,27 +48,27 @@ namespace pf
     /*! Assignment operator */
     INLINE array& operator= (const array &other) {
       if (this->elem != NULL && this->elemNum != other->elemNum) {
-        PF_DELETE_ARRAY(this->elem);
+        GBE_DELETE_ARRAY(this->elem);
         this->elem = NULL;
         this->elemNum = 0;
       }
       this->elemNum = other.elemNum;
       if (this->elemNum) {
         if (this->elem == NULL)
-          this->elem = PF_NEW_ARRAY(T, this->elemNum);
+          this->elem = GBE_NEW_ARRAY(T, this->elemNum);
         for (size_t i = 0; i < this->elemNum; ++i) this->elem[i] = other.elem[i];
       } else
         this->elem = NULL;
       return *this;
     }
     /*! Delete the allocated elements */
-    INLINE ~array(void) { PF_SAFE_DELETE_ARRAY(elem); }
+    INLINE ~array(void) { GBE_SAFE_DELETE_ARRAY(elem); }
     /*! Free the already allocated elements and allocate a new array */
     INLINE void resize(size_t elemNum_) {
       if (elemNum_ != this->elemNum) {
-        PF_SAFE_DELETE_ARRAY(elem);
+        GBE_SAFE_DELETE_ARRAY(elem);
         if (elemNum_)
-          this->elem = PF_NEW_ARRAY(T, elemNum_);
+          this->elem = GBE_NEW_ARRAY(T, elemNum_);
         else
           this->elem = NULL;
         this->elemNum = elemNum_;
@@ -87,12 +87,12 @@ namespace pf
     INLINE T *end(void) { return this->elem + elemNum; }
     /*! Get element at position index (with a bound check) */
     INLINE T &operator[] (size_t index) {
-      PF_ASSERT(elem && index < elemNum);
+      GBE_ASSERT(elem && index < elemNum);
       return elem[index];
     }
     /*! Get element at position index (with bound check) */
     INLINE const T &operator[] (size_t index) const {
-      PF_ASSERT(elem && index < elemNum);
+      GBE_ASSERT(elem && index < elemNum);
       return elem[index];
     }
     /*! Return the number of elements */
@@ -100,9 +100,9 @@ namespace pf
   private:
     T *elem;        //!< Points to the elements
     size_t elemNum; //!< Number of elements in the array
-    PF_CLASS(array);
+    GBE_CLASS(array);
   };
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_ARRAY_HPP__ */
+#endif /* __GBE_ARRAY_HPP__ */
 
index 07b2fda..95efaca 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_ATOMIC_HPP__
-#define __PF_ATOMIC_HPP__
+#ifndef __GBE_ATOMIC_HPP__
+#define __GBE_ATOMIC_HPP__
 
 #include "sys/intrinsics.hpp"
 
-namespace pf
+namespace gbe
 {
   template <typename T>
   struct AtomicInternal {
@@ -46,12 +46,12 @@ namespace pf
 
   private:
     volatile T data;
-    PF_STRUCT(AtomicInternal);
+    GBE_STRUCT(AtomicInternal);
   };
 
   typedef AtomicInternal<atomic32_t> Atomic32;
   typedef AtomicInternal<atomic_t> Atomic;
 }
 
-#endif /* __PF_ATOMIC_HPP__ */
+#endif /* __GBE_ATOMIC_HPP__ */
 
index 9182a98..2d8dab2 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_BARRIER_H__
-#define __PF_BARRIER_H__
+#ifndef __GBE_BARRIER_H__
+#define __GBE_BARRIER_H__
 
 #include "sys/condition.hpp"
 
-namespace pf
+namespace gbe
 {
   /*! system barrier using operating system */
   class BarrierSys
@@ -52,7 +52,7 @@ namespace pf
     size_t count, full_size;
     MutexSys count_mutex;
     ConditionSys cond;
-    PF_CLASS(BarrierSys);
+    GBE_CLASS(BarrierSys);
   };
 
   /* default barrier type */
index 27923f2..2649ed7 100644 (file)
@@ -25,7 +25,7 @@
 
 #if defined(__GNUC__)
 
-namespace pf
+namespace gbe
 {
   // This is an implementation of POSIX "compatible" condition variables for
   // Win32, as described by Douglas C. Schmidt and Irfan Pyarali:
@@ -47,7 +47,7 @@ namespace pf
 
   ConditionSys::ConditionSys ()
   {
-    cond = (Mingw32Cond *) PF_NEW(Mingw32Cond);
+    cond = (Mingw32Cond *) GBE_NEW(Mingw32Cond);
     ((Mingw32Cond *)cond)->waiters_count = 0;
     ((Mingw32Cond *)cond)->events[MINGW32_COND_SIGNAL]    = CreateEvent(NULL, FALSE, FALSE, NULL);
     ((Mingw32Cond *)cond)->events[MINGW32_COND_BROADCAST] = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -59,7 +59,7 @@ namespace pf
     CloseHandle(((Mingw32Cond *)cond)->events[MINGW32_COND_SIGNAL]);
     CloseHandle(((Mingw32Cond *)cond)->events[MINGW32_COND_BROADCAST]);
     DeleteCriticalSection(&((Mingw32Cond *)cond)->waiters_count_lock);
-    PF_DELETE((Mingw32Cond *)cond);
+    GBE_DELETE((Mingw32Cond *)cond);
   }
 
   void ConditionSys::wait(MutexSys& mutex)
@@ -112,28 +112,28 @@ namespace pf
     if (have_waiters)
       SetEvent(cv->events[MINGW32_COND_BROADCAST]);
   }
-} /* namespace pf */
+} /* namespace gbe */
 #else
 
-namespace pf
+namespace gbe
 {
   /*! system condition using windows API */
-  ConditionSys::ConditionSys () { cond = PF_NEW(CONDITION_VARIABLE); InitializeConditionVariable((CONDITION_VARIABLE*)cond); }
-  ConditionSys::~ConditionSys() { PF_DELETE((CONDITION_VARIABLE*)cond); }
+  ConditionSys::ConditionSys () { cond = GBE_NEW(CONDITION_VARIABLE); InitializeConditionVariable((CONDITION_VARIABLE*)cond); }
+  ConditionSys::~ConditionSys() { GBE_DELETE((CONDITION_VARIABLE*)cond); }
   void ConditionSys::wait(MutexSys& mutex) { SleepConditionVariableCS((CONDITION_VARIABLE*)cond, (CRITICAL_SECTION*)mutex.mutex, INFINITE); }
   void ConditionSys::broadcast() { WakeAllConditionVariable((CONDITION_VARIABLE*)cond); }
-} /* namespace pf */
+} /* namespace gbe */
 #endif /* __GNUC__ */
 #endif /* __WIN32__ */
 
 #if defined(__UNIX__)
 #include <pthread.h>
-namespace pf
+namespace gbe
 {
-  ConditionSys::ConditionSys () { cond = PF_NEW(pthread_cond_t); pthread_cond_init((pthread_cond_t*)cond,NULL); }
-  ConditionSys::~ConditionSys() { PF_DELETE((pthread_cond_t*)cond); }
+  ConditionSys::ConditionSys () { cond = GBE_NEW(pthread_cond_t); pthread_cond_init((pthread_cond_t*)cond,NULL); }
+  ConditionSys::~ConditionSys() { GBE_DELETE((pthread_cond_t*)cond); }
   void ConditionSys::wait(MutexSys& mutex) { pthread_cond_wait((pthread_cond_t*)cond, (pthread_mutex_t*)mutex.mutex); }
   void ConditionSys::broadcast() { pthread_cond_broadcast((pthread_cond_t*)cond); }
-} /* namespace pf */
+} /* namespace gbe */
 #endif /* __UNIX__ */
 
index a6d71f7..531366c 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_CONDITION_HPP__
-#define __PF_CONDITION_HPP__
+#ifndef __GBE_CONDITION_HPP__
+#define __GBE_CONDITION_HPP__
 
 #include "sys/mutex.hpp"
 
-namespace pf
+namespace gbe
 {
   class ConditionSys
   {
index 9849d11..326540b 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_CONSTANTS_HPP__
-#define __PF_CONSTANTS_HPP__
+#ifndef __GBE_CONSTANTS_HPP__
+#define __GBE_CONSTANTS_HPP__
 
 #ifndef NULL
 #define NULL 0
@@ -26,7 +26,7 @@
 
 #include <limits>
 
-namespace pf
+namespace gbe
 {
   static struct NullTy {
   } null MAYBE_UNUSED;
index 3661fee..47c2193 100644 (file)
@@ -20,7 +20,7 @@
 #include "sys/default_path.hpp"
 #include "platform.hpp"
 
-namespace pf
+namespace gbe
 {
   const char *defaultPath[] = {
     "./share/",
@@ -34,5 +34,5 @@ namespace pf
     "../../data/"
   };
   const size_t defaultPathNum = ARRAY_ELEM_NUM(defaultPath);
-} /* namespace pf */
+} /* namespace gbe */
 
index 5f84179..96ad88b 100644 (file)
 
 #include <cstdlib>
 
-namespace pf
+namespace gbe
 {
   /*! Where you may find data files and shaders */
   extern const char *defaultPath[];
   /*! Number of default paths */
   extern const size_t defaultPathNum;
-} /* namespace pf */
+} /* namespace gbe */
 
 #endif /* __DEFAULT_PATH_HPP__ */
 
index 58221f5..64948fb 100644 (file)
@@ -20,7 +20,7 @@
 #include "sys/platform.hpp"
 #include "sys/filename.hpp"
 
-namespace pf
+namespace gbe
 {
 #ifdef __WIN32__
   const char path_sep = '\\';
index 4f4fb39..f66fa96 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_FILENAME_HPP__
-#define __PF_FILENAME_HPP__
+#ifndef __GBE_FILENAME_HPP__
+#define __GBE_FILENAME_HPP__
 
 #include "platform.hpp"
 #include <string>
 #include <cstdio>
 
-namespace pf
+namespace gbe
 {
   /*! Convenience class for handling file names and paths. */
   class FileName
@@ -64,9 +64,9 @@ namespace pf
     friend std::ostream& operator<<(std::ostream& cout, const FileName& filename);
   private:
     std::string filename;
-    PF_CLASS(FileName);
+    GBE_CLASS(FileName);
   };
 }
 
-#endif /* __PF_FILENAME_HPP__ */
+#endif /* __GBE_FILENAME_HPP__ */
 
index 68593ec..f1edea9 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_FIXED_ARRAY_HPP__
-#define __PF_FIXED_ARRAY_HPP__
+#ifndef __GBE_FIXED_ARRAY_HPP__
+#define __GBE_FIXED_ARRAY_HPP__
 
 #include "platform.hpp"
 #include <cstring>
 
-namespace pf
+namespace gbe
 {
   /*! Regular C array but with bound checks */
   template<typename T, size_t N>
@@ -58,22 +58,22 @@ namespace pf
     T& back(void) { return *(end() - 1); }
     /*! Get element at position index (with bound check) */
     INLINE T& operator[] (size_t index) {
-      PF_ASSERT(index < size());
+      GBE_ASSERT(index < size());
       return elem[index];
     }
     /*! Get element at position index (with bound check) */
     INLINE const T& operator[] (size_t index) const {
-      PF_ASSERT(index < size());
+      GBE_ASSERT(index < size());
       return elem[index];
     }
   private:
     T elem[N];            //!< Store the elements
     STATIC_ASSERT(N > 0); //!< zero element is not allowed
-    PF_CLASS(fixed_array);
+    GBE_CLASS(fixed_array);
   };
 
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_FIXED_ARRAY_HPP__ */
+#endif /* __GBE_FIXED_ARRAY_HPP__ */
 
 
index ab1a317..e11444b 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_HASH_MAP_HPP__
-#define __PF_HASH_MAP_HPP__
+#ifndef __GBE_HASH_MAP_HPP__
+#define __GBE_HASH_MAP_HPP__
 
 #include "sys/platform.hpp"
 
@@ -28,7 +28,7 @@
 #include <tr1/unordered_map>
 #endif /* __MSVC__ */
 
-namespace pf
+namespace gbe
 {
   /*! Add specific allocator to the hash map */
   template <class Key,
@@ -65,9 +65,9 @@ namespace pf
       parent_type(first,last,n,hf,eql,a) {}
     /*! Copy constructor */
     INLINE hash_map(const hash_map &other) : parent_type(other) {}
-    PF_CLASS(hash_map);
+    GBE_CLASS(hash_map);
   };
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_HASH_MAP_HPP__ */
+#endif /* __GBE_HASH_MAP_HPP__ */
 
index 99f5552..e9b2faf 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_INTRINSICS_H__
-#define __PF_INTRINSICS_H__
+#ifndef __GBE_INTRINSICS_H__
+#define __GBE_INTRINSICS_H__
 
 #include "sys/platform.hpp"
 #include <xmmintrin.h>
 
 #include <intrin.h>
 
-#define PF_COMPILER_WRITE_BARRIER       _WriteBarrier()
-#define PF_COMPILER_READ_WRITE_BARRIER  _ReadWriteBarrier()
+#define GBE_COMPILER_WRITE_BARRIER       _WriteBarrier()
+#define GBE_COMPILER_READ_WRITE_BARRIER  _ReadWriteBarrier()
 
 #if _MSC_VER >= 1400
 #pragma intrinsic(_ReadBarrier)
-#define PF_COMPILER_READ_BARRIER        _ReadBarrier()
+#define GBE_COMPILER_READ_BARRIER        _ReadBarrier()
 #else
-#define PF_COMPILER_READ_BARRIER        _ReadWriteBarrier()
+#define GBE_COMPILER_READ_BARRIER        _ReadWriteBarrier()
 #endif /* _MSC_VER >= 1400 */
 
 INLINE int __bsf(int v) {
@@ -184,27 +184,27 @@ INLINE int32 atomic_cmpxchg(int32 volatile* value, const int32 input, int32 comp
 
 #endif /* defined(__X86_64__) */
 
-#define PF_COMPILER_READ_WRITE_BARRIER    asm volatile("" ::: "memory");
-#define PF_COMPILER_WRITE_BARRIER         PF_COMPILER_READ_WRITE_BARRIER
-#define PF_COMPILER_READ_BARRIER          PF_COMPILER_READ_WRITE_BARRIER
+#define GBE_COMPILER_READ_WRITE_BARRIER    asm volatile("" ::: "memory");
+#define GBE_COMPILER_WRITE_BARRIER         GBE_COMPILER_READ_WRITE_BARRIER
+#define GBE_COMPILER_READ_BARRIER          GBE_COMPILER_READ_WRITE_BARRIER
 
 #endif /* __MSVC__ */
 
 template <typename T>
 INLINE T __load_acquire(volatile T *ptr)
 {
-  PF_COMPILER_READ_WRITE_BARRIER;
+  GBE_COMPILER_READ_WRITE_BARRIER;
   T x = *ptr; // for x86, load == load_acquire
-  PF_COMPILER_READ_WRITE_BARRIER;
+  GBE_COMPILER_READ_WRITE_BARRIER;
   return x;
 }
 
 template <typename T>
 INLINE void __store_release(volatile T *ptr, T x)
 {
-  PF_COMPILER_READ_WRITE_BARRIER;
+  GBE_COMPILER_READ_WRITE_BARRIER;
   *ptr = x; // for x86, store == store_release
-  PF_COMPILER_READ_WRITE_BARRIER;
+  GBE_COMPILER_READ_WRITE_BARRIER;
 }
-#endif /* __PF_INTRINSICS_H__ */
+#endif /* __GBE_INTRINSICS_H__ */
 
index 815bd59..16e8b6d 100644 (file)
@@ -30,7 +30,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-namespace pf
+namespace gbe
 {
   /* opens a shared library */
   lib_t openLibrary(const std::string& file)
@@ -62,7 +62,7 @@ namespace pf
 
 #include <dlfcn.h>
 
-namespace pf
+namespace gbe
 {
   /* opens a shared library */
   lib_t openLibrary(const std::string& file)
index 8dcb1a9..d4c7e3e 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_LIBRARY_HPP__
-#define __PF_LIBRARY_HPP__
+#ifndef __GBE_LIBRARY_HPP__
+#define __GBE_LIBRARY_HPP__
 
 #include <string>
 
 #include "sys/platform.hpp"
 
-namespace pf
+namespace gbe
 {
   /*! type for shared library */
   typedef struct opaque_lib_t* lib_t;
@@ -34,7 +34,7 @@ namespace pf
   void* getSymbol(lib_t lib, const std::string& sym);
   /*! unloads a shared library */
   void closeLibrary(lib_t lib);
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_LIBRARY_HPP__ */
+#endif /* __GBE_LIBRARY_HPP__ */
 
index 6f479d2..d9dbe7d 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_LIST_HPP__
-#define __PF_LIST_HPP__
+#ifndef __GBE_LIST_HPP__
+#define __GBE_LIST_HPP__
 
 #include "sys/platform.hpp"
 #include <list>
 
-namespace pf
+namespace gbe
 {
   /*! Use custom allocator instead of std one */
   template <typename T>
@@ -52,9 +52,9 @@ namespace pf
       parent_type(first, last, a) {}
     /*! Copy constructor */
     INLINE list(const list &x) : parent_type(x) {}
-    PF_CLASS(list);
+    GBE_CLASS(list);
   };
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_LIST_HPP__ */
+#endif /* __GBE_LIST_HPP__ */
 
index 6f4c840..27f9e47 100644 (file)
@@ -20,7 +20,7 @@
 #include "sys/logging.hpp"
 #include "sys/filename.hpp"
 
-namespace pf
+namespace gbe
 {
   LoggerStream::LoggerStream(void) : next(NULL) {}
   LoggerStream::~LoggerStream(void) {}
@@ -40,14 +40,14 @@ namespace pf
 
   Logger::Logger(void) : streams(NULL) {
     const uint32 threadNum = 1;
-    this->buffers = PF_NEW_ARRAY(LoggerBuffer, threadNum);
+    this->buffers = GBE_NEW_ARRAY(LoggerBuffer, threadNum);
     for (uint32 i = 0; i < threadNum; ++i) this->buffers[i].logger = this;
     this->startTime = getSeconds();
   }
 
   Logger::~Logger(void) {
     FATAL_IF(streams != NULL, "Remove all streams before deleting the logger");
-    PF_DELETE_ARRAY(buffers);
+    GBE_DELETE_ARRAY(buffers);
   }
 
   void Logger::output(const std::string &str) {
@@ -83,5 +83,5 @@ namespace pf
   }
 
   Logger *logger = NULL;
-} /* namespace pf */
+} /* namespace gbe */
 
index ae69e32..95c1020 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_LOGGING_HPP__
-#define __PF_LOGGING_HPP__
+#ifndef __GBE_LOGGING_HPP__
+#define __GBE_LOGGING_HPP__
 
 #include "sys/mutex.hpp"
 #include "sys/platform.hpp"
 #include <sstream>
 #include <iomanip>
 
-namespace pf
+namespace gbe
 {
   class Logger;
   class LoggerBuffer;
@@ -52,7 +52,7 @@ namespace pf
       file(file), function(function), line(line) {}
     const char *file, *function;
     int line;
-    PF_CLASS(LoggerInfo);
+    GBE_CLASS(LoggerInfo);
   };
 
   /*! Used to lazily create strings from the user defined logs. When destroyed
@@ -74,7 +74,7 @@ namespace pf
     LoggerBuffer(void);
     Logger *logger;       //!< The logger that created this buffer
     std::stringstream ss; //!< Stores all the user strings
-    PF_CLASS(LoggerBuffer);
+    GBE_CLASS(LoggerBuffer);
   };
 
   /*! Central class to log anything from the engine */
@@ -99,43 +99,43 @@ namespace pf
     LoggerStream *streams; //!< All the output streams
     LoggerBuffer *buffers; //!< One buffer per thread
     double startTime;      //!< When the logger has been created
-    PF_CLASS(Logger);
+    GBE_CLASS(Logger);
   };
 
   /*! We have one logger for the application */
   extern Logger *logger;
 
-} /* namespace pf */
+} /* namespace gbe */
 
 /*! Macros to handle logging information in the code */
-#define PF_LOG_HERE LoggerInfo(__FILE__, __FUNCTION__, __LINE__)
-#define PF_INFO " ######## " << PF_LOG_HERE
+#define GBE_LOG_HERE LoggerInfo(__FILE__, __FUNCTION__, __LINE__)
+#define GBE_INFO " ######## " << GBE_LOG_HERE
 
 /*! Verbose macros: they add logging position and thread ID */
-#define PF_WARNING_V(MSG) do {                                                \
-  if (logger) *logger << "WARNING " << MSG << PF_INFO << "\n" << loggerFlush; \
+#define GBE_WARNING_V(MSG) do {                                                \
+  if (logger) *logger << "WARNING " << MSG << GBE_INFO << "\n" << loggerFlush; \
 } while (0)
 
-#define PF_ERROR_V(MSG)   do {                                                \
-  if (logger) *logger << "ERROR " << MSG << PF_INFO << "\n" << loggerFlush;   \
+#define GBE_ERROR_V(MSG)   do {                                                \
+  if (logger) *logger << "ERROR " << MSG << GBE_INFO << "\n" << loggerFlush;   \
 } while (0)
 
-#define PF_MSG_V(MSG)     do {                                                \
-  if (logger) *logger << MSG << PF_INFO << "\n" << loggerFlush;               \
+#define GBE_MSG_V(MSG)     do {                                                \
+  if (logger) *logger << MSG << GBE_INFO << "\n" << loggerFlush;               \
 } while (0)
 
 /*! Regular macros: just the user message */
-#define PF_WARNING(MSG) do {                                                  \
+#define GBE_WARNING(MSG) do {                                                  \
   if (logger) *logger << "WARNING " << MSG << "\n" << loggerFlush;            \
 } while (0)
 
-#define PF_ERROR(MSG)   do {                                                  \
+#define GBE_ERROR(MSG)   do {                                                  \
   if (logger) *logger << "ERROR " << MSG << "\n" << loggerFlush;              \
 } while (0)
 
-#define PF_MSG(MSG)     do {                                                  \
+#define GBE_MSG(MSG)     do {                                                  \
   if (logger) *logger << MSG << "\n" << loggerFlush;                          \
 } while (0)
 
-#endif /* __PF_LOGGING_HPP__ */
+#endif /* __GBE_LOGGING_HPP__ */
 
index c673b86..00ef912 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_MAP_HPP__
-#define __PF_MAP_HPP__
+#ifndef __GBE_MAP_HPP__
+#define __GBE_MAP_HPP__
 
 #include "sys/platform.hpp"
 #include <map>
@@ -55,9 +55,9 @@ namespace pf
       parent_type(first, last, comp, a) {}
     /*! Copy constructor */
     INLINE map(const map& x) : parent_type(x) {}
-    PF_CLASS(map);
+    GBE_CLASS(map);
   };
 } /* namespace pf */
 
-#endif /* __PF_MAP_HPP__ */
+#endif /* __GBE_MAP_HPP__ */
 
index 590ad5d..0a3aff5 100644 (file)
@@ -24,7 +24,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-namespace pf
+namespace gbe
 {
   /*! system mutex using windows API */
   MutexSys::MutexSys( void ) { mutex = new CRITICAL_SECTION; InitializeCriticalSection((CRITICAL_SECTION*)mutex); }
@@ -37,7 +37,7 @@ namespace pf
 #if defined(__UNIX__)
 #include <pthread.h>
 
-namespace pf
+namespace gbe
 {
   /*! system mutex using pthreads */
   MutexSys::MutexSys( void ) { mutex = new pthread_mutex_t; pthread_mutex_init((pthread_mutex_t*)mutex, NULL); }
index b29b3c8..2af0ff4 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_MUTEX_H__
-#define __PF_MUTEX_H__
+#ifndef __GBE_MUTEX_H__
+#define __GBE_MUTEX_H__
 
 #include "platform.hpp"
 #include "atomic.hpp"
 #include <xmmintrin.h>
 
-namespace pf
+namespace gbe
 {
   class MutexSys {
     friend class ConditionSys;
@@ -37,7 +37,7 @@ namespace pf
     void* mutex;
     MutexSys(const MutexSys&); // don't implement
     MutexSys& operator= (const MutexSys&); // don't implement
-    PF_CLASS(MutexSys);
+    GBE_CLASS(MutexSys);
   };
 
   /*! active mutex */
@@ -45,10 +45,10 @@ namespace pf
   public:
     INLINE MutexActive(void) : $lock(LOCK_IS_FREE) {}
     INLINE void lock(void) {
-      PF_COMPILER_READ_BARRIER;
+      GBE_COMPILER_READ_BARRIER;
       while (cmpxchg($lock, LOCK_IS_TAKEN, LOCK_IS_FREE) != LOCK_IS_FREE)
         _mm_pause();
-      PF_COMPILER_READ_BARRIER;
+      GBE_COMPILER_READ_BARRIER;
     }
     INLINE void unlock(void) { $lock.storeRelease(LOCK_IS_FREE); }
   protected:
@@ -56,7 +56,7 @@ namespace pf
     Atomic $lock;
     MutexActive(const MutexActive&); // don't implement
     MutexActive& operator=(const MutexActive&); // don't implement
-    PF_CLASS(MutexActive);
+    GBE_CLASS(MutexActive);
   };
 
   /*! safe mutex lock and unlock helper */
@@ -68,7 +68,7 @@ namespace pf
     Mutex& mutex;
     Lock(const Lock&); // don't implement
     Lock& operator= (const Lock&); // don't implement
-    PF_CLASS(Lock);
+    GBE_CLASS(Lock);
   };
 }
 
index 96fab95..8b07de8 100644 (file)
@@ -30,7 +30,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-namespace pf
+namespace gbe
 {
   double getSeconds() {
     LARGE_INTEGER freq, val;
@@ -42,7 +42,7 @@ namespace pf
   void FATAL(const std::string &msg) {
     std::cerr << msg << std::endl;
     MessageBox(NULL, msg.c_str(), "Fatal Error", MB_OK | MB_ICONEXCLAMATION);
-    PF_ASSERT(0);
+    GBE_ASSERT(0);
 #ifdef __GNUC__
     exit(-1);
 #else
@@ -50,7 +50,7 @@ namespace pf
 #endif /* __GNUC__ */
   }
 
-} /* namespace pf */
+} /* namespace gbe */
 #endif /* __WIN32__ */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -61,7 +61,7 @@ namespace pf
 
 #include <sys/time.h>
 
-namespace pf
+namespace gbe
 {
   double getSeconds() {
     struct timeval tp; gettimeofday(&tp,NULL);
@@ -70,10 +70,10 @@ namespace pf
 
   void FATAL(const std::string &msg) {
     std::cerr << msg << std::endl;
-    PF_ASSERT(0);
+    GBE_ASSERT(0);
     _exit(-1);
   }
-} /* namespace pf */
+} /* namespace gbe */
 
 #endif /* __UNIX__ */
 
index ecd205f..921c4a5 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_PLATFORM_HPP__
-#define __PF_PLATFORM_HPP__
+#ifndef __GBE_PLATFORM_HPP__
+#define __GBE_PLATFORM_HPP__
 #include <cstddef>
 #include <cstdlib>
 #include <cstdio>
 
 /*! Run-time assertion */
 #ifndef NDEBUG
-#define PF_ASSERT(EXPR) do {            \
+#define GBE_ASSERT(EXPR) do {            \
   if (UNLIKELY(!(EXPR))) assert(EXPR);  \
 } while (0)
 #else
-#define PF_ASSERT(EXPR) do { } while (0)
+#define GBE_ASSERT(EXPR) do { } while (0)
 #endif
 
 /*! Compile-time assertion */
@@ -221,8 +221,8 @@ do {                                                 \
 } while (0)
 
 /* Safe deletion macros */
-#define PF_SAFE_DELETE_ARRAY(x) do { if (x != NULL) PF_DELETE_ARRAY(x); } while (0)
-#define PF_SAFE_DELETE(x) do { if (x != NULL) PF_DELETE(x); } while (0)
+#define GBE_SAFE_DELETE_ARRAY(x) do { if (x != NULL) GBE_DELETE_ARRAY(x); } while (0)
+#define GBE_SAFE_DELETE(x) do { if (x != NULL) GBE_DELETE(x); } while (0)
 
 /* Number of elements in an array */
 #define ARRAY_ELEM_NUM(x) (sizeof(x) / sizeof(x[0]))
@@ -246,15 +246,15 @@ struct AlignOf
 ////////////////////////////////////////////////////////////////////////////////
 #if defined __WIN32__
   #if defined __GNUC__
-    #define PF_EXPORT_SYMBOL __attribute__ ((dllexport))
-    #define PF_IMPORT_SYMBOL __attribute__ ((dllimport))
+    #define GBE_EXPORT_SYMBOL __attribute__ ((dllexport))
+    #define GBE_IMPORT_SYMBOL __attribute__ ((dllimport))
   #else
-    #define PF_IMPORT_SYMBOL __declspec(dllimport)
-    #define PF_EXPORT_SYMBOL __declspec(dllexport)
+    #define GBE_IMPORT_SYMBOL __declspec(dllimport)
+    #define GBE_EXPORT_SYMBOL __declspec(dllexport)
   #endif /* __GNUC__ */
 #else
-  #define PF_EXPORT_SYMBOL __attribute__ ((visibility ("default")))
-  #define PF_IMPORT_SYMBOL
+  #define GBE_EXPORT_SYMBOL __attribute__ ((visibility ("default")))
+  #define GBE_IMPORT_SYMBOL
 #endif /* __WIN32__ */
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -320,7 +320,7 @@ private:
 #include "sys/constants.hpp"
 #include "sys/alloc.hpp"
 
-namespace pf
+namespace gbe
 {
   /*! selects */
   INLINE bool  select(bool s, bool  t , bool f) { return s ? t : f; }
@@ -367,7 +367,7 @@ namespace pf
   /** returns performance counter in seconds */
   double getSeconds();
 
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_PLATFORM_HPP__ */
+#endif /* __GBE_PLATFORM_HPP__ */
 
index 1672f54..63d5e12 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_REF_HPP__
-#define __PF_REF_HPP__
+#ifndef __GBE_REF_HPP__
+#define __GBE_REF_HPP__
 
 #include "sys/atomic.hpp"
 #include "sys/alloc.hpp"
 
-namespace pf
+namespace gbe
 {
   class RefCount
   {
@@ -52,11 +52,11 @@ namespace pf
     INLINE Ref(NullTy) : ptr(NULL) {}
     INLINE Ref(const Ref& input) : ptr(input.ptr) { if ( ptr ) ptr->refInc(); }
     INLINE Ref(Type* const input) : ptr(input) { if (ptr) ptr->refInc(); }
-    INLINE ~Ref(void) { if (ptr && ptr->refDec()) PF_DELETE(ptr); }
+    INLINE ~Ref(void) { if (ptr && ptr->refDec()) GBE_DELETE(ptr); }
 
     INLINE Ref& operator= (const Ref &input) {
       if (input.ptr) input.ptr->refInc();
-      if (ptr && ptr->refDec()) PF_DELETE(ptr);
+      if (ptr && ptr->refDec()) GBE_DELETE(ptr);
       *(Type**)&ptr = input.ptr;
       return *this;
     }
@@ -83,7 +83,7 @@ namespace pf
     INLINE       Ref<TypeOut> cast()       { return Ref<TypeOut>(static_cast<TypeOut*>(ptr)); }
     template<typename TypeOut>
     INLINE const Ref<TypeOut> cast() const { return Ref<TypeOut>(static_cast<TypeOut*>(ptr)); }
-    PF_CLASS(Ref);
+    GBE_CLASS(Ref);
   };
 
   template<typename Type> INLINE bool operator< ( const Ref<Type>& a, const Ref<Type>& b ) { return a.ptr <  b.ptr ; }
@@ -95,5 +95,5 @@ namespace pf
   template<typename Type> INLINE bool operator!= ( const Ref<Type>& a, const Ref<Type>& b ) { return a.ptr != b.ptr ; }
 }
 
-#endif /* __PF_REF_HPP__ */
+#endif /* __GBE_REF_HPP__ */
 
index efaf7ed..94f726e 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_SET_HPP__
-#define __PF_SET_HPP__
+#ifndef __GBE_SET_HPP__
+#define __GBE_SET_HPP__
 
 #include "sys/platform.hpp"
 #include <set>
 
-namespace pf
+namespace gbe
 {
   /*! Add our custom allocator to std::set */
   template<class Key, class Pred = std::less<Key>>
@@ -50,10 +50,10 @@ namespace pf
       parent_type(first, last, comp, a) {}
     /*! Copy constructor */
     INLINE set(const set& x) : parent_type(x) {}
-    PF_CLASS(set);
+    GBE_CLASS(set);
   };
 
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_SET_HPP__ */
+#endif /* __GBE_SET_HPP__ */
 
index 093bb26..d05d0f1 100644 (file)
@@ -42,7 +42,7 @@ namespace std
   }
 
 }
-namespace pf
+namespace gbe
 {
   /* $Id: strtok_r.c,v 1.1 2003/12/03 15:22:23 chris_reid Exp $ */
   /*
@@ -118,7 +118,7 @@ namespace pf
 
   std::string loadFile(std::ifstream &stream)
   {
-    PF_ASSERT(stream.is_open());
+    GBE_ASSERT(stream.is_open());
     std::string line;
     std::stringstream text;
     while (std::getline(stream, line))
index 0447966..61894b1 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_STRING_H__
-#define __PF_STRING_H__
+#ifndef __GBE_STRING_HPP__
+#define __GBE_STRING_HPP__
 
 #include "sys/platform.hpp"
 #include "sys/filename.hpp"
@@ -32,12 +32,12 @@ namespace std
 {
   string strlwr(const string& s);
   string strupr(const string& s);
-
   template<typename T> INLINE string stringOf(const T& v) {
     stringstream s; s << v; return s.str();
   }
-}
-namespace pf
+} /* namespace std */
+
+namespace gbe
 {
   /*! Compare two strings */
   bool strequal(const char *s1, const char *s2);
@@ -49,5 +49,7 @@ namespace pf
   std::string loadFile(const FileName &path);
   /*! Load a file from a stream and copies it into a string */
   std::string loadFile(std::ifstream &stream);
-}
-#endif
+} /* namespace gbe */
+
+#endif /* __GBE_STRING_HPP__ */
+
index 15a5609..ca85777 100644 (file)
@@ -23,7 +23,7 @@
 /// All Platforms
 ////////////////////////////////////////////////////////////////////////////////
 
-namespace pf
+namespace gbe
 {
   /* return platform name */
   std::string getPlatformName() {
@@ -66,7 +66,7 @@ namespace pf
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-namespace pf
+namespace gbe
 {
   /* get the full path to the running executable */
   std::string getExecutableFileName() {
@@ -93,7 +93,7 @@ namespace pf
 #include <stdio.h>
 #include <unistd.h>
 
-namespace pf
+namespace gbe
 {
   /* get the full path to the running executable */
   std::string getExecutableFileName() {
@@ -115,7 +115,7 @@ namespace pf
 
 #include <mach-o/dyld.h>
 
-namespace pf
+namespace gbe
 {
   /* get the full path to the running executable */
   std::string getExecutableFileName()
@@ -137,7 +137,7 @@ namespace pf
 
 #include <unistd.h>
 
-namespace pf
+namespace gbe
 {
   /* return the number of logical threads of the system */
   int getNumberOfLogicalThreads() {
index 5679ddb..4d3f31b 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_SYSINFO_H__
-#define __PF_SYSINFO_H__
+#ifndef __GBE_SYSINFO_HPP__
+#define __GBE_SYSINFO_HPP__
 
 #include "sys/platform.hpp"
 
 #include <string>
 
-namespace pf
+namespace gbe
 {
   /*! get the full path to the running executable */
   std::string getExecutableFileName();
index 12503ce..160a3b6 100644 (file)
@@ -31,7 +31,7 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-namespace pf
+namespace gbe
 {
   /*! creates a hardware thread running on specific core */
   thread_t createThread(thread_func f, void* arg, size_t stack_size, int affinity)
@@ -86,7 +86,7 @@ namespace pf
 ////////////////////////////////////////////////////////////////////////////////
 
 #ifdef __LINUX__
-namespace pf
+namespace gbe
 {
   /*! set affinity of the calling thread */
   void setAffinity(int affinity)
@@ -114,7 +114,7 @@ namespace pf
 #include <mach/thread_policy.h>
 #include <mach/mach_init.h>
 
-namespace pf
+namespace gbe
 {
   /*! set affinity of the calling thread */
   void setAffinity(int affinity)
@@ -138,7 +138,7 @@ namespace pf
 #include <pthread.h>
 #include <sched.h>
 
-namespace pf
+namespace gbe
 {
   struct ThreadStartupData {
     int affinity;
@@ -148,7 +148,7 @@ namespace pf
 
   static void* threadStartup(ThreadStartupData* parg)
   {
-    ThreadStartupData arg = *parg; PF_DELETE(parg); parg = NULL;
+    ThreadStartupData arg = *parg; GBE_DELETE(parg); parg = NULL;
     setAffinity(arg.affinity);
     arg.f(arg.arg);
     return NULL;
@@ -160,8 +160,8 @@ namespace pf
     pthread_attr_init(&attr);
     if (stack_size > 0) pthread_attr_setstacksize (&attr, stack_size);
 
-    pthread_t* tid = PF_NEW(pthread_t);
-    ThreadStartupData* startup = PF_NEW(ThreadStartupData);
+    pthread_t* tid = GBE_NEW(pthread_t);
+    ThreadStartupData* startup = GBE_NEW(ThreadStartupData);
     startup->f = f;
     startup->arg = arg;
     startup->affinity = affinity;
@@ -180,16 +180,16 @@ namespace pf
   void join(thread_t tid) {
     if (pthread_join(*(pthread_t*)tid, NULL) != 0)
       FATAL("pthread_join error");
-    PF_DELETE((pthread_t*)tid);
+    GBE_DELETE((pthread_t*)tid);
   }
 
   void destroyThread(thread_t tid) {
     pthread_cancel(*(pthread_t*)tid);
-    PF_DELETE((pthread_t*)tid);
+    GBE_DELETE((pthread_t*)tid);
   }
 
   tls_t createTls() {
-    pthread_key_t* key = PF_NEW(pthread_key_t);
+    pthread_key_t* key = GBE_NEW(pthread_key_t);
     if (pthread_key_create(key,NULL) != 0)
       FATAL("pthread_key_create error");
     return tls_t(key);
@@ -207,7 +207,7 @@ namespace pf
   void destroyTls(tls_t tls) {
     if (pthread_key_delete(*(pthread_key_t*)tls) != 0)
       FATAL("pthread_key_delete error");
-    PF_DELETE((pthread_key_t*)tls);
+    GBE_DELETE((pthread_key_t*)tls);
   }
 }
 #endif
index 0611ef7..8548372 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_THREAD_HPP__
-#define __PF_THREAD_HPP__
+#ifndef __GBE_THREAD_HPP__
+#define __GBE_THREAD_HPP__
 
 #include "sys/platform.hpp"
 
-namespace pf
+namespace gbe
 {
   /*! Type for thread */
   typedef struct opaque_thread_t* thread_t;
@@ -50,5 +50,5 @@ namespace pf
   void destroyTls(tls_t tls);
 }
 
-#endif /* __PF_THREAD_HPP__ */
+#endif /* __GBE_THREAD_HPP__ */
 
index a100770..2a9f6bc 100644 (file)
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_VECTOR_HPP__
-#define __PF_VECTOR_HPP__
+#ifndef __GBE_VECTOR_HPP__
+#define __GBE_VECTOR_HPP__
 
 #include "sys/platform.hpp"
 #include <vector>
 
-namespace pf
+namespace gbe
 {
   /*! Add bound checks to the standard vector class and use the internal
    *  allocator
@@ -56,17 +56,17 @@ namespace pf
       parent_type(first, last, a) {}
     /*! Get element at position index (with a bound check) */
     T &operator[] (size_t index) {
-      PF_ASSERT(index < this->size());
+      GBE_ASSERT(index < this->size());
       return parent_type::operator[] (index);
     }
     /*! Get element at position index (with a bound check) */
     const T &operator[] (size_t index) const {
-      PF_ASSERT(index < this->size());
+      GBE_ASSERT(index < this->size());
       return parent_type::operator[] (index);
     }
-    PF_CLASS(vector);
+    GBE_CLASS(vector);
   };
-} /* namespace pf */
+} /* namespace gbe */
 
-#endif /* __PF_VECTOR_HPP__ */
+#endif /* __GBE_VECTOR_HPP__ */
 
index fea1bbc..9d69095 100644 (file)
@@ -17,8 +17,8 @@
  * Author: Benjamin Segovia <benjamin.segovia@intel.com>
  */
 
-#ifndef __PF_UTEST_HPP__
-#define __PF_UTEST_HPP__
+#ifndef __GBE_UTEST_HPP__
+#define __GBE_UTEST_HPP__
 
 #include <vector>
 
@@ -49,5 +49,5 @@ namespace pf
 /*! Register a new unit test */
 #define UTEST_REGISTER(FN) static const pf::UTest __##NAME##__(FN, #FN);
 
-#endif /* __PF_UTEST_HPP__ */
+#endif /* __GBE_UTEST_HPP__ */
 
index 5107594..5c5c4ce 100644 (file)
@@ -72,22 +72,22 @@ void utest_console(void)
   WinOpen(640, 480);
   ScriptSystem *scriptSystem = LuaScriptSystemCreate();
   CommandSystemStart(*scriptSystem);
-  UTestConsoleDisplay *display = PF_NEW(UTestConsoleDisplay);
+  UTestConsoleDisplay *display = GBE_NEW(UTestConsoleDisplay);
   Console *console = ConsoleNew(*scriptSystem, *display);
   console->addCompletion("while");
   console->addCompletion("whilewhile");
   for (;;) {
-    Ref<InputControl> input = PF_NEW(InputControl);
+    Ref<InputControl> input = GBE_NEW(InputControl);
     input->processEvents();
-    if (input->getKey(PF_KEY_ASCII_ESC))
+    if (input->getKey(GBE_KEY_ASCII_ESC))
       break;
     console->update(*input);
     WinSwapBuffers();
   }
   CommandSystemEnd();
-  PF_DELETE(console);
-  PF_DELETE(scriptSystem);
-  PF_DELETE(display);
+  GBE_DELETE(console);
+  GBE_DELETE(scriptSystem);
+  GBE_DELETE(display);
   WinClose();
 }
 
index d6b0fa9..cf00280 100644 (file)
@@ -34,7 +34,7 @@ void utest_font(void)
     const FileName path(std::string(defaultPath[i]) + fontName);
     if (font.load(path)) break;
   }
-  PF_ASSERT(i < defaultPathNum);
+  GBE_ASSERT(i < defaultPathNum);
 }
 
 UTEST_REGISTER(utest_font);
index 289ef7f..f1a0182 100644 (file)
@@ -31,7 +31,7 @@ VARS(player0, "ben", "player name");
 #define _RUN_SCRIPT(STR, RUN_MODE) do {\
   ScriptStatus status;\
   scriptSystem->RUN_MODE(STR, status);\
-  if (!status.success) PF_ERROR(status.msg);\
+  if (!status.success) GBE_ERROR(status.msg);\
 } while (0)
 #define RUN(STR) _RUN_SCRIPT(STR,run)
 #define RUN_NON_PROTECTED(STR) _RUN_SCRIPT(STR,runNonProtected)
@@ -48,10 +48,10 @@ void utest_lua(void)
   RUN_NON_PROTECTED("print(pf.cv.coucou)");
   RUN("cv.player0 = \"hop\"");
   RUN_NON_PROTECTED("print(pf.cv.player0)");
-  if (coucou() == 1) PF_MSG("coucou is equal to 1");
+  if (coucou() == 1) GBE_MSG("coucou is equal to 1");
 
   CommandSystemEnd();
-  PF_DELETE(scriptSystem);
+  GBE_DELETE(scriptSystem);
 }
 
 UTEST_REGISTER(utest_lua)
index cf2db0a..c9bdc0c 100644 (file)
@@ -52,7 +52,7 @@ namespace pf
   //static const FileName objName("sponza.obj");
 
   static RTTriangle *ObjComputeTriangle(const Obj &obj) {
-    RTTriangle *tris = PF_NEW_ARRAY(RTTriangle, obj.triNum);
+    RTTriangle *tris = GBE_NEW_ARRAY(RTTriangle, obj.triNum);
     for (size_t i = 0; i < obj.triNum; ++i) {
       const vec3f &v0 = obj.vert[obj.tri[i].v[0]].p; 
       const vec3f &v1 = obj.vert[obj.tri[i].v[1]].p; 
@@ -124,24 +124,24 @@ namespace pf
   static void rayTrace(int w, int h, const uint32 *c) {
     FPSCamera fpsCam;
     const RTCamera cam(fpsCam.org, fpsCam.up, fpsCam.view, fpsCam.fov, fpsCam.ratio);
-    uint32 *rgba = PF_NEW_ARRAY(uint32, w * h);
+    uint32 *rgba = GBE_NEW_ARRAY(uint32, w * h);
     std::memset(rgba, 0, sizeof(uint32) * w * h);
-    PF_COMPILER_READ_WRITE_BARRIER;
+    GBE_COMPILER_READ_WRITE_BARRIER;
     const double t = getSeconds();
-    Task *rayTask = PF_NEW(TaskRayTrace<singleRay>, *intersector,
+    Task *rayTask = GBE_NEW(TaskRayTrace<singleRay>, *intersector,
                            cam, c, rgba, w, h/RayPacket::height);
-    Task *returnToMain = PF_NEW(TaskInterruptMain);
+    Task *returnToMain = GBE_NEW(TaskInterruptMain);
     rayTask->starts(returnToMain);
     rayTask->scheduled();
     returnToMain->scheduled();
     TaskingSystemEnter();
     const double dt = getSeconds() - t;
-    PF_MSG_V(dt * 1000. << " msec - " << CAMW * CAMH / dt << " rays/s");
+    GBE_MSG_V(dt * 1000. << " msec - " << CAMW * CAMH / dt << " rays/s");
     if (singleRay)
       stbi_write_bmp("single.bmp", w, h, 4, rgba);
     else
       stbi_write_bmp("packet.bmp", w, h, 4, rgba);
-    PF_DELETE_ARRAY(rgba);
+    GBE_DELETE_ARRAY(rgba);
   }
 
   static void RTStart(void)
@@ -150,34 +150,34 @@ namespace pf
     size_t path = 0;
     for (path = 0; path < defaultPathNum; ++path)
       if (obj.load(FileName(defaultPath[path]) + objName)) {
-        PF_MSG_V("Obj: " << objName << " loaded from " << defaultPath[path]);
+        GBE_MSG_V("Obj: " << objName << " loaded from " << defaultPath[path]);
         break;
       }
     if (path == defaultPathNum)
-      PF_WARNING_V("Obj: " << objName << " not found");
+      GBE_WARNING_V("Obj: " << objName << " not found");
 
     // Build the BVH
     RTTriangle *tris = ObjComputeTriangle(obj);
-    Ref<BVH2<RTTriangle>> bvh = PF_NEW(BVH2<RTTriangle>);
+    Ref<BVH2<RTTriangle>> bvh = GBE_NEW(BVH2<RTTriangle>);
     buildBVH2(tris, obj.triNum, *bvh);
-    PF_DELETE_ARRAY(tris);
+    GBE_DELETE_ARRAY(tris);
 
     // Now we have an intersector on the triangle soup
-    intersector = PF_NEW(BVH2Traverser<RTTriangle>, bvh);
+    intersector = GBE_NEW(BVH2Traverser<RTTriangle>, bvh);
 
     // Compute some triangle color
-    uint32 *c = PF_NEW_ARRAY(uint32, bvh->primNum);
+    uint32 *c = GBE_NEW_ARRAY(uint32, bvh->primNum);
     for (uint32 i = 0; i < bvh->primNum; ++i) {
       c[i] = rand();
       c[i] |= 0xff000000;
     }
 
     // Ray trace now
-    PF_MSG_V("Packet ray tracing");
+    GBE_MSG_V("Packet ray tracing");
     for (int i = 0; i < 16; ++i) rayTrace<false>(CAMW, CAMH, c);
-    PF_MSG_V("Single ray tracing");
+    GBE_MSG_V("Single ray tracing");
     for (int i = 0; i < 16; ++i) rayTrace<true>(CAMW, CAMH, c);
-    PF_DELETE_ARRAY(c);
+    GBE_DELETE_ARRAY(c);
   }
 
   static void RTEnd(void) { intersector = NULL; }
index 419c3d7..97797f3 100644 (file)
@@ -51,8 +51,8 @@ public:
 };
 
 START_UTEST(TestDummy)
-  Task *done = PF_NEW(TaskDone);
-  Task *nothing = PF_NEW(TaskDummy);
+  Task *done = GBE_NEW(TaskDone);
+  Task *nothing = GBE_NEW(TaskDummy);
   nothing->starts(done);
   done->scheduled();
   nothing->scheduled();
@@ -72,11 +72,11 @@ public:
 
 START_UTEST(TestTaskSet)
   const size_t elemNum = 1 << 20;
-  uint32 *array = PF_NEW_ARRAY(uint32, elemNum);
+  uint32 *array = GBE_NEW_ARRAY(uint32, elemNum);
   for (size_t i = 0; i < elemNum; ++i) array[i] = 0;
   double t = getSeconds();
-  Task *done = PF_NEW(TaskDone);
-  Task *taskSet = PF_NEW(TaskSetSimple, elemNum, array);
+  Task *done = GBE_NEW(TaskDone);
+  Task *taskSet = GBE_NEW(TaskSetSimple, elemNum, array);
   taskSet->starts(done);
   done->scheduled();
   taskSet->scheduled();
@@ -85,7 +85,7 @@ START_UTEST(TestTaskSet)
   std::cout << t * 1000. << " ms" << std::endl;
   for (size_t i = 0; i < elemNum; ++i)
     FATAL_IF(array[i] == 0, "TestTaskSet failed");
-  PF_DELETE_ARRAY(array);
+  GBE_DELETE_ARRAY(array);
 END_UTEST(TestTaskSet)
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -112,8 +112,8 @@ Task* TaskNode::run(void) {
   if (this->lvl == maxLevel)
     this->value++;
   else {
-    Task *left  = PF_NEW(TaskNode, this->value, this->lvl+1, this->root);
-    Task *right = PF_NEW(TaskNode, this->value, this->lvl+1, this->root);
+    Task *left  = GBE_NEW(TaskNode, this->value, this->lvl+1, this->root);
+    Task *right = GBE_NEW(TaskNode, this->value, this->lvl+1, this->root);
     left->ends(this->root);
     right->ends(this->root);
     left->scheduled();
@@ -145,8 +145,8 @@ Task* TaskNodeOpt::run(void) {
     this->value++;
     return NULL;
   } else {
-    Task *left  = PF_NEW(TaskNode, this->value, this->lvl+1, this->root);
-    Task *right = PF_NEW(TaskNode, this->value, this->lvl+1, this->root);
+    Task *left  = GBE_NEW(TaskNode, this->value, this->lvl+1, this->root);
+    Task *right = GBE_NEW(TaskNode, this->value, this->lvl+1, this->root);
     left->ends(this->root);
     right->ends(this->root);
     left->scheduled();
@@ -173,8 +173,8 @@ Task *TaskCascadeNode::run(void) {
   if (this->lvl == maxLevel)
     this->value++;
   else {
-    Task *left  = PF_NEW(TaskCascadeNode, this->value, this->lvl+1);
-    Task *right = PF_NEW(TaskCascadeNode, this->value, this->lvl+1);
+    Task *left  = GBE_NEW(TaskCascadeNode, this->value, this->lvl+1);
+    Task *right = GBE_NEW(TaskCascadeNode, this->value, this->lvl+1);
     left->ends(this);
     right->ends(this);
     left->scheduled();
@@ -200,8 +200,8 @@ Task *TaskCascadeNodeOpt::run(void) {
     this->value++;
     return NULL;
   } else {
-    Task *left  = PF_NEW(TaskCascadeNode, this->value, this->lvl+1);
-    Task *right = PF_NEW(TaskCascadeNode, this->value, this->lvl+1);
+    Task *left  = GBE_NEW(TaskCascadeNode, this->value, this->lvl+1);
+    Task *right = GBE_NEW(TaskCascadeNode, this->value, this->lvl+1);
     left->ends(this);
     right->ends(this);
     left->scheduled();
@@ -215,8 +215,8 @@ START_UTEST(TestTree)
   Atomic value(0u);
   std::cout << "nodeNum = " << (2 << maxLevel) - 1 << std::endl;
   double t = getSeconds();
-  Task *done = PF_NEW(TaskDone);
-  Task *root = PF_NEW(NodeType, value, 0);
+  Task *done = GBE_NEW(TaskDone);
+  Task *root = GBE_NEW(NodeType, value, 0);
   root->starts(done);
   done->scheduled();
   root->scheduled();
@@ -241,14 +241,14 @@ void TaskAllocate::run(size_t elemID) {
   Task *tasks[allocNum];
   for (int j = 0; j < iterNum; ++j) {
     const int taskNum = rand() % allocNum;
-    for (int i = 0; i < taskNum; ++i) tasks[i] = PF_NEW(TaskDummy);
-    for (int i = 0; i < taskNum; ++i) PF_DELETE(tasks[i]);
+    for (int i = 0; i < taskNum; ++i) tasks[i] = GBE_NEW(TaskDummy);
+    for (int i = 0; i < taskNum; ++i) GBE_DELETE(tasks[i]);
   }
 }
 
 START_UTEST(TestAllocator)
-  Task *done = PF_NEW(TaskDone);
-  Task *allocate = PF_NEW(TaskAllocate, 1 << 10);
+  Task *done = GBE_NEW(TaskDone);
+  Task *allocate = GBE_NEW(TaskAllocate, 1 << 10);
   double t = getSeconds();
   allocate->starts(done);
   done->scheduled();
@@ -269,7 +269,7 @@ public:
   virtual Task* run(void) {
     if (lvl == 0)
       for (size_t i = 0; i < taskToSpawn; ++i) {
-        Task *task = PF_NEW(TaskFull, "TaskFullLvl1", counter, 1);
+        Task *task = GBE_NEW(TaskFull, "TaskFullLvl1", counter, 1);
         task->ends(this);
         task->scheduled();
       }
@@ -284,9 +284,9 @@ public:
 START_UTEST(TestFullQueue)
   Atomic counter(0u);
   double t = getSeconds();
-  Task *done = PF_NEW(TaskDone);
+  Task *done = GBE_NEW(TaskDone);
   for (size_t i = 0; i < 64; ++i) {
-    Task *task = PF_NEW(TaskFull, "TaskFull", counter);
+    Task *task = GBE_NEW(TaskFull, "TaskFull", counter);
     task->starts(done);
     task->scheduled();
   }
@@ -311,7 +311,7 @@ public:
     else {
       const uint32 threadNum = TaskingSystemGetThreadNum();
       for (uint32 i = 0; i < taskToSpawn; ++i) {
-        Task *task = PF_NEW(TaskAffinity, done.ptr, counter, 1);
+        Task *task = GBE_NEW(TaskAffinity, done.ptr, counter, 1);
         task->setAffinity(i % threadNum);
         task->ends(this);
         task->scheduled();
@@ -329,9 +329,9 @@ START_UTEST(TestAffinity)
   for (int i = 0; i < 8; ++i) {
     Atomic counter(0u);
     double t = getSeconds();
-    Ref<Task> done = PF_NEW(TaskDone);
+    Ref<Task> done = GBE_NEW(TaskDone);
     for (size_t i = 0; i < batchNum; ++i) {
-      Task *task = PF_NEW(TaskAffinity, done.ptr, counter);
+      Task *task = GBE_NEW(TaskAffinity, done.ptr, counter);
       task->starts(done.ptr);
       task->scheduled();
     }
@@ -366,9 +366,9 @@ public:
 
 Task *TaskFiboSpawn::run(void) {
   if (rank > 1) {
-    TaskFiboSpawn *left = PF_NEW(TaskFiboSpawn, rank-1, &this->sumLeft);
-    TaskFiboSpawn *right = PF_NEW(TaskFiboSpawn, rank-2, &this->sumRight);
-    FiboSumTask *sum = PF_NEW(FiboSumTask, this);
+    TaskFiboSpawn *left = GBE_NEW(TaskFiboSpawn, rank-1, &this->sumLeft);
+    TaskFiboSpawn *right = GBE_NEW(TaskFiboSpawn, rank-2, &this->sumRight);
+    FiboSumTask *sum = GBE_NEW(FiboSumTask, this);
     left->starts(sum);
     right->starts(sum);
     sum->ends(this);
@@ -409,8 +409,8 @@ START_UTEST(TestFibo)
   uint64 sum;
   double t = getSeconds();
   fiboNum = 0u;
-  Ref<TaskFiboSpawn> fibo = PF_NEW(TaskFiboSpawn, rank, &sum);
-  Task *done = PF_NEW(TaskDone);
+  Ref<TaskFiboSpawn> fibo = GBE_NEW(TaskFiboSpawn, rank, &sum);
+  Task *done = GBE_NEW(TaskDone);
   fibo->starts(done);
   fibo->scheduled();
   done->scheduled();
@@ -452,15 +452,15 @@ START_UTEST(TestMultiDependency)
   static const uint32 triggeredTaskToSpawn = 512;
   static const uint32 valueToSetNum = multiTaskToSpawn;
 
-  int32 *toSet = PF_NEW_ARRAY(int32, valueToSetNum);
+  int32 *toSet = GBE_NEW_ARRAY(int32, valueToSetNum);
   Atomic32 dst(0);
-  Task *doneTask = PF_NEW(TaskDone);
+  Task *doneTask = GBE_NEW(TaskDone);
   for (uint32 i = 0; i < valueToSetNum; ++i) toSet[i] = 0;
   for (uint32 i = 0; i < multiTaskToSpawn; ++i) {
-    Ref<TaskMultiTrigger> task = PF_NEW(TaskMultiTrigger, toSet + i);
+    Ref<TaskMultiTrigger> task = GBE_NEW(TaskMultiTrigger, toSet + i);
     for (uint32 j = 0; j < triggeredTaskToSpawn; ++j) {
-      Ref<Task> triggered = PF_NEW(TaskTriggered, toSet + i, dst);
-      Ref<Task> dummy = PF_NEW(TaskDummy);
+      Ref<Task> triggered = GBE_NEW(TaskTriggered, toSet + i, dst);
+      Ref<Task> dummy = GBE_NEW(TaskDummy);
       task->multiStarts(dummy);
       dummy->starts(triggered);
       triggered->starts(doneTask);
@@ -471,7 +471,7 @@ START_UTEST(TestMultiDependency)
   }
   doneTask->scheduled();
   TaskingSystemEnter();
-  PF_DELETE_ARRAY(toSet);
+  GBE_DELETE_ARRAY(toSet);
   const uint32 result = dst;
   std::cout << "result: " << result << std::endl;
   FATAL_IF(result != multiTaskToSpawn * triggeredTaskToSpawn,
@@ -485,14 +485,14 @@ START_UTEST(TestMultiDependencyTwoStage)
   static const uint32 triggeredTaskToSpawn = 512;
   static const uint32 valueToSetNum = multiTaskToSpawn;
 
-  int32 *toSet = PF_NEW_ARRAY(int32, valueToSetNum);
+  int32 *toSet = GBE_NEW_ARRAY(int32, valueToSetNum);
   Atomic32 dst(0);
-  Task *doneTask = PF_NEW(TaskDone);
+  Task *doneTask = GBE_NEW(TaskDone);
   for (uint32 i = 0; i < valueToSetNum; ++i) toSet[i] = 0;
   for (uint32 i = 0; i < multiTaskToSpawn; ++i) {
-    Ref<TaskMultiTrigger> task = PF_NEW(TaskMultiTrigger, toSet + i);
+    Ref<TaskMultiTrigger> task = GBE_NEW(TaskMultiTrigger, toSet + i);
     for (uint32 j = 0; j < triggeredTaskToSpawn; ++j) {
-      Ref<Task> triggered = PF_NEW(TaskTriggered, toSet + i, dst);
+      Ref<Task> triggered = GBE_NEW(TaskTriggered, toSet + i, dst);
       task->multiStarts(triggered);
       triggered->starts(doneTask);
       triggered->scheduled();
@@ -501,7 +501,7 @@ START_UTEST(TestMultiDependencyTwoStage)
   }
   doneTask->scheduled();
   TaskingSystemEnter();
-  PF_DELETE_ARRAY(toSet);
+  GBE_DELETE_ARRAY(toSet);
   const uint32 result = dst;
   std::cout << "result: " << result << std::endl;
   FATAL_IF(result != multiTaskToSpawn * triggeredTaskToSpawn,
@@ -517,15 +517,15 @@ START_UTEST(TestMultiDependencyRandomStart)
   static const uint32 repeatNum = 8;
   Random rand;
   for (uint32 i = 0; i < repeatNum; ++i) {
-    int32 *toSet = PF_NEW_ARRAY(int32, valueToSetNum);
+    int32 *toSet = GBE_NEW_ARRAY(int32, valueToSetNum);
     Atomic32 dst(0);
-    Ref<Task> doneTask = PF_NEW(TaskDone);
+    Ref<Task> doneTask = GBE_NEW(TaskDone);
     for (uint32 i = 0; i < valueToSetNum; ++i) toSet[i] = 0;
     for (uint32 i = 0; i < multiTaskToSpawn; ++i) {
-      Ref<TaskMultiTrigger> task = PF_NEW(TaskMultiTrigger, toSet + i);
+      Ref<TaskMultiTrigger> task = GBE_NEW(TaskMultiTrigger, toSet + i);
       bool isScheduled = false;
       for (uint32 j = 0; j < triggeredTaskToSpawn; ++j) {
-        Ref<Task> triggered = PF_NEW(TaskTriggered, toSet + i, dst);
+        Ref<Task> triggered = GBE_NEW(TaskTriggered, toSet + i, dst);
         task->multiStarts(triggered);
         triggered->starts(doneTask);
         triggered->scheduled();
@@ -538,7 +538,7 @@ START_UTEST(TestMultiDependencyRandomStart)
     }
     doneTask->scheduled();
     TaskingSystemEnter();
-    PF_DELETE_ARRAY(toSet);
+    GBE_DELETE_ARRAY(toSet);
     const uint32 result = dst;
     std::cout << "result: " << result << std::endl;
     FATAL_IF(result != multiTaskToSpawn * triggeredTaskToSpawn,
@@ -567,9 +567,9 @@ START_UTEST(TestLockUnlock)
 {
   static const uint32 taskNum = 1024;
   int32 shared = 0;
-  Ref<Task> doneTask = PF_NEW(TaskDone);
+  Ref<Task> doneTask = GBE_NEW(TaskDone);
   for (uint32 i = 0; i < taskNum; ++i) {
-    Task *updateTask = PF_NEW(TaskLockUnlock, &shared);
+    Task *updateTask = GBE_NEW(TaskLockUnlock, &shared);
     updateTask->starts(doneTask);
     updateTask->scheduled();
   }
@@ -582,7 +582,7 @@ END_UTEST(TestLockUnlock)
 ///////////////////////////////////////////////////////////////////////////////
 // Test tasking profiler
 ///////////////////////////////////////////////////////////////////////////////
-#if PF_TASK_PROFILER
+#if GBE_TASK_PROFILER
 class UTestProfiler : public TaskProfiler
 {
 public:
@@ -608,7 +608,7 @@ public:
 
 START_UTEST(TestProfiler)
 {
-  UTestProfiler *profiler = PF_NEW(UTestProfiler);
+  UTestProfiler *profiler = GBE_NEW(UTestProfiler);
   TaskingSystemSetProfiler(profiler);
   TestFibo();
   TestTaskSet();
@@ -625,10 +625,10 @@ START_UTEST(TestProfiler)
   OUTPUT_FIELD(endNum);    
 #undef OUTPUT_FIELD
   TaskingSystemSetProfiler(NULL);
-  PF_DELETE(profiler);
+  GBE_DELETE(profiler);
 }
 END_UTEST(TestProfiler)
-#endif /* PF_TASK_PROFILER */
+#endif /* GBE_TASK_PROFILER */
 
 /*! Run all tasking tests */
 void utest_tasking(void)