[opengtl-commits] [560] add C function that call the MemoryManager |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 560
Author: cyrille
Date: 2009-02-27 14:30:25 +0100 (Fri, 27 Feb 2009)
Log Message:
-----------
add C function that call the MemoryManager
Modified Paths:
--------------
trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt
trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.h
Added Paths:
-----------
trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.cpp
Modified: trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt 2009-02-27 13:30:01 UTC (rev 559)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt 2009-02-27 13:30:25 UTC (rev 560)
@@ -29,6 +29,7 @@
TypesManager.cpp
Value.cpp
# Internal files
+ wrappers/Allocate.cpp
AST/AccessorExpression.cpp
AST/BinaryExpression.cpp
AST/ConvertExpression.cpp
Added: trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.cpp (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.cpp 2009-02-27 13:30:25 UTC (rev 560)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2009 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * 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, or (at your option) any later version of the License.
+ *
+ * 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; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "Allocate.h"
+
+#include "../MemoryManager_p.h"
+
+extern "C" {
+
+void* gtl_malloc( int _size )
+{
+ return GTLCore::MemoryManager::allocate(_size);
+}
+
+void gtl_free( void* _ptr )
+{
+ GTLCore::MemoryManager::desallocate(_ptr);
+}
+
+}
Property changes on: trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.cpp
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.h 2009-02-27 13:30:01 UTC (rev 559)
+++ trunk/OpenGTL/OpenGTL/GTLCore/wrappers/Allocate.h 2009-02-27 13:30:25 UTC (rev 560)
@@ -22,6 +22,13 @@
#include <stdlib.h>
+extern "C" {
+
+void* gtl_malloc( int _size );
+void gtl_free( void* _data );
+
+}
+
template<class T>
T* gtlAllocate(int elt = 1)
{