# HG changeset patch # User Kaito Tokumori # Date 1385217062 -32400 # Node ID 4e785859098537f03f576f38b82875ce8d938436 # Parent d75a89b101767001004a574140dc8d18262c6c8b remove malloc , free and include diff -r d75a89b10176 -r 4e7858590985 global_longjump.c --- a/global_longjump.c Thu Nov 14 13:16:46 2013 +0900 +++ b/global_longjump.c Sat Nov 23 23:31:02 2013 +0900 @@ -1,3 +1,8 @@ +/* + please use pointer version. that is spuerior to this. + */ + + #include #include #include diff -r d75a89b10176 -r 4e7858590985 pointer_longjump.c --- a/pointer_longjump.c Thu Nov 14 13:16:46 2013 +0900 +++ b/pointer_longjump.c Sat Nov 23 23:31:02 2013 +0900 @@ -1,6 +1,5 @@ #include #include -#include __code code1(int n,__code(*__return)(int,void *,int *),void *__environment,int *__ret_p){ printf("code1 : code entry1\n"); @@ -15,14 +14,14 @@ int main1 (){ __code (*__return)(); - void *__environment; + void *__environment ; int retval; int *__ret_p; + jmp_buf j_buf; __ret_p = &retval; printf("main1 : main1 entry\n"); - __environment = (void*)malloc(sizeof(jmp_buf)); + __environment = &j_buf; if (setjmp(__environment)){ - free(__environment); printf("main1 : main1 return\n"); return retval; }