From 7360ca8f8be8158d66db693bf95b3d1a9add65d5 Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Wed, 19 Apr 2000 01:38:18 +0000 Subject: [PATCH] 20000418-18:35 GMT-8 Ron Pinkas * source/compiler/harbour.c * Modified hb_compCodeBlockEnd() to call hb_compOptimizeJumps() and release pNOOPs and pJumps pointers. --- harbour/ChangeLog | 8 ++++++-- harbour/source/compiler/harbour.c | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 40ecf6ec7e..0a358bbe8a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +20000418-18:35 GMT-8 Ron Pinkas + + * source/compiler/harbour.c + * Modified hb_compCodeBlockEnd() to call hb_compOptimizeJumps() and release pNOOPs and pJumps pointers. + 20000419-00:28 GMT+1 Victor Szakats * source/rtl/gtcrs/gtcrs.c @@ -49,7 +54,6 @@ doc/en/set.txt *Fixed doc by fixing the errors reported by chen ->>>>>>> 1.1996 2000-04-18 14:55 GMT-4 David G. Holm * source/rtl/gtwin/gtwin.c ! Don't generate a key code for Caps Lock. @@ -61,7 +65,7 @@ * source/compiler/genobj32.c * Progressive fixes to support genc.c latest changes. -20000419-05:30 GMT-8 Ron Pinkas +20000418-05:30 GMT-8 Ron Pinkas * source/compiler/hvm.c + Added PCodes HB_P_JAMPSHORT, HB_P_JAMPSHORTFALSE and HB_P_JAMPSHORTTRUE diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index f7926392d2..81f485d531 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -2718,6 +2718,10 @@ void hb_compCodeBlockEnd( void ) USHORT wPos; PVAR pVar, pFree; + if ( hb_comp_iJumpOptimize ) + if ( hb_comp_functions.pLast && hb_comp_functions.pLast->iNOOPs ) + hb_compOptimizeJumps(); + pCodeblock = hb_comp_functions.pLast; /* return to pcode buffer of function/codeblock in which the current @@ -2786,6 +2790,15 @@ void hb_compCodeBlockEnd( void ) pVar = pVar->pNext; hb_xfree( ( void * ) pFree ); } + + /* Release the NOOP array. */ + if ( pCodeblock->pNOOPs ) + hb_xfree( ( void * ) pCodeblock->pNOOPs ); + + /* Release the Jumps array. */ + if ( pCodeblock->pJumps ) + hb_xfree( ( void * ) pCodeblock->pJumps ); + hb_xfree( ( void * ) pCodeblock ); }