From 7e48eb6d93f5e3ca06c7b96ce44ea472fac6b995 Mon Sep 17 00:00:00 2001 From: cherierm Date: Fri, 11 Jan 2008 09:56:55 +0000 Subject: [PATCH] add the inclusion of the dbg_help.h header, remove the unnecessary code and use xbt_new0 instead calloc git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5188 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/backtrace_windows.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/xbt/backtrace_windows.c b/src/xbt/backtrace_windows.c index c7229664e3..1feb4ce7a1 100644 --- a/src/xbt/backtrace_windows.c +++ b/src/xbt/backtrace_windows.c @@ -14,6 +14,8 @@ * : support for application self-debugging. */ +#include + /* Pointer function to SymInitialize() */ typedef BOOL (WINAPI *xbt_pfn_sym_initialize_t)(HANDLE, PSTR , BOOL); @@ -97,8 +99,6 @@ backtrace (void **buffer, int size); char ** backtrace_symbols (void *const *buffer, int size); -#endif - void xbt_ex_setup_backtrace(xbt_ex_t *e) { int i; char **backtrace = backtrace_symbols (e->bt, e->used); @@ -164,7 +164,7 @@ backtrace (void **buffer, int size) while(pos < size) { - stack_frame = (void*)calloc(1,sizeof(STACKFRAME)); + stack_frame = (void*)xbt_new0(STACKFRAME,1); if(!stack_frame) { @@ -241,7 +241,7 @@ backtrace_symbols (void *const *buffer, int size) return NULL; } - strings = (char**)calloc(size,sizeof(char*)); + strings = xbt_new0(char*,size); if(NULL == strings) { @@ -309,7 +309,7 @@ dbg_hlp_init(HANDLE process_handle) } /* allocation */ - dbg_hlp = (xbt_debug_hlp_t)calloc(1,sizeof(s_xbt_debug_hlp_t)); + dbg_hlp = xbt_new0(s_xbt_debug_hlp_t,1); if(!dbg_hlp) return ENOMEM; @@ -432,8 +432,3 @@ dbg_hlp_finalize(void) return 0; } -/* dummy implementation. We won't use the result, but ex.h needs it to be defined */ -int backtrace (void **__array, int __size) { - return 0; -} - -- 2.20.1