--- /dev/null
+/* $Id: datatypes.h 5497 2008-05-26 12:19:15Z cristianrosa $ */
+
+/* Copyright (c) 2008 Martin Quinson, Cristian Rosa.
+ 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. */
+
+#ifndef MC_DATATYPE_H
+#define MC_DATATYPE_H
+#include "xbt/misc.h"
+#include "xbt/swag.h"
+#include "xbt/fifo.h"
+
+SG_BEGIN_DECL()
+
+/******************************* Transitions **********************************/
+typedef enum {
+ mc_isend,
+ mc_irecv,
+ mc_test,
+ mc_wait,
+ mc_waitany
+} mc_trans_type_t;
+
+typedef struct s_mc_transition *mc_transition_t;
+
+SG_END_DECL()
+
+#endif /* _MC_MC_H */
--- /dev/null
+/* $Id: simix.h 5497 2008-05-26 12:19:15Z cristianrosa $ */
+
+/* Copyright (c) 2008 Martin Quinson, Cristian Rosa.
+ 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. */
+
+#ifndef _MC_MC_H
+#define _MC_MC_H
+
+#include "xbt/misc.h"
+#include "xbt/fifo.h"
+#include "xbt/dict.h"
+#include "xbt/function_types.h"
+#include "mc/datatypes.h"
+#include "simix/datatypes.h"
+
+SG_BEGIN_DECL()
+
+/********************************* Global *************************************/
+XBT_PUBLIC(void) MC_init(int);
+XBT_PUBLIC(void) MC_assert(int);
+XBT_PUBLIC(void) MC_modelcheck(int);
+
+/******************************* Transitions **********************************/
+XBT_PUBLIC(mc_transition_t) MC_create_transition(mc_trans_type_t, smx_process_t, smx_rdv_t, smx_comm_t);
+XBT_PUBLIC(void) MC_transition_set_comm(mc_transition_t, smx_comm_t);
+
+/********************************* Memory *************************************/
+XBT_PUBLIC(void) MC_memory_init(void); /* Initialize the memory subsystem */
+XBT_PUBLIC(void) MC_memory_exit(void); /* Finish the memory subsystem */
+
+
+SG_END_DECL()
+
+#endif /* _MC_MC_H */
"Logging specific to MC (memory)");
/* Pointers to each of the heap regions to use */
-void *std_heap;
-void *raw_heap;
-void *actual_heap;
+void *std_heap=NULL;
+void *raw_heap=NULL;
+void *actual_heap=NULL;
/* Pointers to the begining and end of the .data and .bss segment of libsimgrid */
/* They are initialized once at memory_init */
tmp = xbt_strdup(maps->regions[i].pathname);
libname = basename(tmp);
- if( strncmp("libsimgrid.so.2.0.0", libname, 18) == 0 && maps->regions[i].perms & MAP_WRITE){
+ if( strncmp("libsimgrid.so.2.0.0", libname, 18) == 0 && maps->regions[i].perms & MAP_WRITE){ //FIXME: do not hardcode
libsimgrid_data_addr_start = maps->regions[i].start_addr;
libsimgrid_data_size = (size_t)((char *)maps->regions[i+1].end_addr - (char *)maps->regions[i].start_addr);
xbt_free(tmp);
if (p)
ret = mrealloc(actual_heap, p,s);
else
- ret = malloc(s);
+ ret = malloc(s); /* FIXME: shouldn't this be mmalloc? */
} else {
if (p) {
free(p);
void free(void *p)
{
DEBUG1("%p was freed",p);
- xbt_assert(actual_heap != NULL);
+// xbt_assert(actual_heap != NULL); FIXME: I had to comment this
return mfree(actual_heap, p);
}
#include "xbt/setset.h"
#include "xbt/config.h"
#include "xbt/function_types.h"
-#include "mmalloc.h"
+#include "xbt/mmalloc.h"
#include "../simix/private.h"
/****************************** Snapshots ***********************************/
#endif
}
-static double NOW = 0;
+double NOW = 0;
xbt_dynar_t model_list = NULL;
tmgr_history_t history = NULL;
on top of it, so that if we use the default sbrk() region we will not
collide with another malloc package trying to do the same thing, if
the application contains any "hidden" calls to malloc/realloc/free (such
- as inside a system library). */
+ as inside a system library).
+ FIXME: disabled for now */
-void*
-calloc (size_t nmemb, size_t size)
-{
- return (mcalloc ((void*) NULL, nmemb, size));
-}
+//void* calloc (size_t nmemb, size_t size) {
+// return (mcalloc ((void*) NULL, nmemb, size));
+//}
on top of it, so that if we use the default sbrk() region we will not
collide with another malloc package trying to do the same thing, if
the application contains any "hidden" calls to malloc/realloc/free (such
- as inside a system library). */
+ as inside a system library).
+ FIXME: disabled for now */
-void
-free (void* ptr)
-{
- mfree ((void*) NULL, ptr);
-}
+//void free (void* ptr) {
+// mfree ((void*) NULL, ptr);
+//}
on top of it, so that if we use the default sbrk() region we will not
collide with another malloc package trying to do the same thing, if
the application contains any "hidden" calls to malloc/realloc/free (such
- as inside a system library). */
-
-void*
-malloc (size_t size)
-{
- void* result;
- result = mmalloc (NULL, size);
- return (result);
-}
+ as inside a system library).
+ FIXME: disabled for now */
+
+//void* malloc (size_t size) {
+// void* result;
+// result = mmalloc (NULL, size);
+// return (result);
+//}
on top of it, so that if we use the default sbrk() region we will not
collide with another malloc package trying to do the same thing, if
the application contains any "hidden" calls to malloc/realloc/free (such
- as inside a system library). */
+ as inside a system library).
+ FIXME: disabled for now */
-void *
-realloc (void *ptr, size_t size)
-{
- void* result;
+//void * realloc (void *ptr, size_t size) {
+// void* result;
- result = mrealloc (NULL, ptr, size);
- return (result);
-}
+// result = mrealloc (NULL, ptr, size);
+// return (result);
+//}