SG_BEGIN_DECL
/** Helper function used to throw exceptions in C */
-XBT_ATTRIB_NORETURN XBT_PUBLIC void _xbt_throw(char* message, int value, const char* file, int line, const char* func);
-
-/** Builds and throws an exception
- * @ingroup XBT_ex_c
- * @hideinitializer
- */
-#define THROW(v) _xbt_throw(NULL, (v), __FILE__, __LINE__, __func__)
+XBT_ATTRIB_NORETURN XBT_PUBLIC void _xbt_throw(char* message, const char* file, int line, const char* func);
/** Builds and throws an exception with a printf-like formatted message
* @ingroup XBT_ex_c
* @hideinitializer
*/
-#define THROWF(v, ...) _xbt_throw(bprintf(__VA_ARGS__), (v), __FILE__, __LINE__, __func__)
+#define THROW(...) _xbt_throw(bprintf(__VA_ARGS__), __FILE__, __LINE__, __func__)
XBT_ATTRIB_NORETURN void xbt_throw_impossible(const char* file, int line, const char* func);
/** Throw an exception because something impossible happened
XBT_LOG_EXTERNAL_CATEGORY(xbt);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_exception, xbt, "Exceptions");
-void _xbt_throw(char* message, int value, const char* file, int line, const char* func)
+void _xbt_throw(char* message, const char* file, int line, const char* func)
{
simgrid::Exception e(
simgrid::xbt::ThrowPoint(file, line, func, simgrid::xbt::Backtrace(), xbt_procname(), xbt_getpid()),
message ? message : "");
xbt_free(message);
- e.value = value;
throw e;
}
switch (type) {
case MMALLOC_TYPE_HEAPINFO:
UNLOCK(mdp);
- THROWF(0, "Asked to free a fragment in a heapinfo block. I'm confused.\n");
+ THROW("Asked to free a fragment in a heapinfo block. I'm confused.\n");
break;
case MMALLOC_TYPE_FREE: /* Already free */
UNLOCK(mdp);
- THROWF(0, "Asked to free a fragment in a block that is already free. I'm puzzled.\n");
+ THROW("Asked to free a fragment in a block that is already free. I'm puzzled.\n");
break;
case MMALLOC_TYPE_UNFRAGMENTED:
if( mdp->heapinfo[block].busy_frag.frag_size[frag_nb] == -1){
UNLOCK(mdp);
- THROWF(0, "Asked to free a fragment that is already free. I'm puzzled\n");
+ THROW("Asked to free a fragment that is already free. I'm puzzled\n");
}
if (MC_is_active() && mdp->heapinfo[block].busy_frag.ignore[frag_nb] > 0)