Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv gs/ DataDesc/
[simgrid.git] / src / gras / DataDesc / tools.c
diff --git a/src/gras/DataDesc/tools.c b/src/gras/DataDesc/tools.c
new file mode 100644 (file)
index 0000000..105e532
--- /dev/null
@@ -0,0 +1,18 @@
+/* gs_tools.c */
+
+#include "gs/gs_private.h"
+
+void *
+gs_memdup(const void * const ptr,
+          const size_t       length) {
+  void * new_ptr = NULL;
+
+  new_ptr = malloc(length);
+
+  if (new_ptr) {
+    memcpy(new_ptr, ptr, length);
+  }
+
+  return new_ptr;
+}
+