Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv include/xbt/context.h src/include/xbt/context.h since users shouldn't mess with it
[simgrid.git] / src / xbt / sysdep.c
index 2ac0871..a3b0a8a 100644 (file)
@@ -1,51 +1,24 @@
 /* $Id$ */
 
-/* gras/sysdep.h -- all system dependency                                   */
+/* sysdep.h -- all system dependency                                        */
 /*  no system header should be loaded out of this file so that we have only */
 /*  one file to check when porting to another OS                            */
 
-/* Authors: Martin Quinson                                                  */
-/* Copyright (C) 2004 the OURAGAN project.                                  */
+/* Copyright (c) 2004 Martin Quinson. All rights reserved.                  */
 
 /* This program is free software; you can redistribute it and/or modify it
  under the terms of the license (GNU LGPL) which comes with this package. */
* under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "gras_private.h"
+#include "xbt/sysdep.h"
+#include "xbt/log.h"
+#include "xbt/error.h"
 
 #include <stdlib.h>
 
-GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(sysdep, gros, "System dependency");
-
-/****
- **** Memory management
- ****/
-
-void* gras_malloc  (long int bytes) {
-   return bytes == 0 ? NULL : (void*) malloc ((size_t) bytes);
-}
-void* gras_malloc0 (long int bytes) {
-   return bytes == 0 ? NULL : (void*) calloc ((size_t) bytes, 1);
-}
-
-void* gras_realloc (void  *memory, long int bytes) {
-   if (bytes == 0) {
-      gras_free(memory);
-      return NULL;
-   } else {
-      return (void*) realloc (memory, (size_t) bytes);
-   }
-}
-
-void  gras_free (void  *memory) {
-   if (memory) {
-      free (memory);
-   }
-}
-
-/****
- **** Misc
- ****/
-
-void gras_abort(void) {
-   abort();
-}
+/* \defgroup XBT_sysdep All system dependency
+ * \brief This section describes many macros/functions that can serve as
+ *  an OS abstraction.
+ */
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sysdep, xbt, "System dependency");
+