Pārlūkot izejas kodu

Moved initialize_allocator to the header files, added header guard and comments to it.

Ioannis Koutras 13 gadi atpakaļ
vecāks
revīzija
297d9e8902

+ 3 - 2
include/dmmlib/CMakeLists.txt

@@ -1,8 +1,9 @@
 project(dmmlib-headers C)
 
 set(dmmlib_HDRS
-	dmmlib.h
-	heap.h
+  dmmlib.h
+  heap.h
+  initialize_allocator.h
 )
 
 install(

+ 36 - 0
include/dmmlib/initialize_allocator.h

@@ -0,0 +1,36 @@
+/**
+ * \file 	initialize_allocator.h
+ * \author 	Ioannis Koutras (joko@microlab.ntua.gr)
+ * \date 	September, 2011
+ * \brief 	dmmlib allocator initializator.
+ */
+
+#ifndef INITIALIZE_ALLOCATOR_H
+#define INITIALIZE_ALLOCATOR_H
+
+#include <dmmlib/heap.h>
+#include "dmm_config.h"
+
+#ifdef WITH_MEMORY_SPACE_AWARENESS
+/**
+ * Initialize an allocator.
+ *
+ * \param allocator The address of the allocator./**
+ * \param starting_address The starting addres of the memory space which the
+ * allocator has to handle.
+ * \param size The total size of the memory space which the allocator has to
+ * handle.
+ */
+void initialize_allocator(allocator_t *allocator, void *starting_address,
+  size_t size);
+#else
+/**
+ * Initialize an allocator.
+ *
+ * \param allocator The address of the allocator.
+ */
+void initialize_allocator(allocator_t *allocator);
+#endif /* WITH_MEMORY_SPACE_AWARENESS */
+
+#endif /* INITIALIZE_ALLOCATOR_H */
+

+ 0 - 8
private-include/initialize_allocator.h

@@ -1,8 +0,0 @@
-#include <dmmlib/heap.h>
-#include "dmm_config.h"
-
-#ifdef WITH_MEMORY_SPACE_AWARENESS
-void initialize_allocator(allocator_t *allocator, void *starting_address, size_t size);
-#else
-void initialize_allocator(allocator_t *allocator);
-#endif /* WITH_MEMORY_SPACE_AWARENESS */

+ 2 - 2
src/initialize_allocator.c

@@ -1,9 +1,9 @@
 #include <unistd.h>
-#include "dmm_config.h"
 #ifdef HAVE_LOCKS
 #include <pthread.h>
 #endif /* HAVE_LOCKS */
-#include "initialize_allocator.h"
+#include <dmmlib/initialize_allocator.h>
+#include "dmm_config.h"
 
 #ifdef WITH_MEMORY_SPACE_AWARENESS
 void initialize_allocator(allocator_t *allocator, void *starting_address, size_t size) {