Skip to content
Snippets Groups Projects
Commit 2066df18 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

memory leak fixed

Rev: src/compilation.h:1.3
parent eb0ca587
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,19 @@ ...@@ -52,6 +52,19 @@
oLd=Y; Y=oLd->previous; oLd=Y; Y=oLd->previous;
#define SEND free(oLd); \ #define SEND free(oLd); \
} }
#define PCODE(X) X
#else
#define PCODE(X)
#endif
#ifdef DEBUG
#define STRMEMBER(X,Y) \
PCODE(if(X) fatal("Variable %s not deallocated properly.\n",Y);) \
ZMEMBER(struct lpc_string *,X,)
#else
#define STRMEMBER(X) \
ZMEMBER(struct lpc_string *,X,)
#endif #endif
#ifdef FILE_STATE #ifdef FILE_STATE
...@@ -62,14 +75,14 @@ ...@@ -62,14 +75,14 @@
ZMEMBER(int,pragma_all_inline,) ZMEMBER(int,pragma_all_inline,)
ZMEMBER(struct inputstate *,istate,) ZMEMBER(struct inputstate *,istate,)
ZMEMBER(struct hash_table *,defines,) ZMEMBER(struct hash_table *,defines,)
ZMEMBER(struct lpc_string *,current_file,) STRMEMBER(current_file,"current_file")
SEND SEND
#endif #endif
#ifdef PROGRAM_STATE #ifdef PROGRAM_STATE
SNAME(program_state,previous_program_state) SNAME(program_state,previous_program_state)
ZMEMBER(INT32,last_line,) ZMEMBER(INT32,last_line,)
ZMEMBER(struct shared_string *,last_file,) STRMEMBER(last_file,"last_file")
ZMEMBER(struct program,fake_program,) ZMEMBER(struct program,fake_program,)
ZMEMBER(node *,init_node,) ZMEMBER(node *,init_node,)
ZMEMBER(INT32,last_pc,) ZMEMBER(INT32,last_pc,)
...@@ -81,6 +94,8 @@ ...@@ -81,6 +94,8 @@
SEND SEND
#endif #endif
#undef PCODE
#undef STRMEMBER
#undef IMEMBER #undef IMEMBER
#undef ZMEMBER #undef ZMEMBER
#undef SNAME #undef SNAME
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment