[Monetdb-developers] [Monetdb-pf-checkins] pathfinder/modules/pftijah/tjc tjc_abssyn.c, , 1.4, 1.5 tjc_abssyn.h, , 1.6, 1.7 tjc_main.c, , 1.10, 1.11 tjc_parse.y, , 1.5, 1.6 tjc_phys_optimize.c, , 1.3, 1.4 tjc_phys_optimize.h, , 1.1, 1.2

Sjoerd Mullender sjoerd at acm.org
Fri Jan 30 09:44:24 CET 2009


Is this a fix that also applies to the Feb2009 branch?

Henning Rode wrote:
> Update of /cvsroot/monetdb/pathfinder/modules/pftijah/tjc
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7540
> 
> Modified Files:
> 	tjc_abssyn.c tjc_abssyn.h tjc_main.c tjc_parse.y 
> 	tjc_phys_optimize.c tjc_phys_optimize.h 
> Log Message:
> forgot to free some allocated memory
> 
> 
> 
> U tjc_main.c
> Index: tjc_main.c
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_main.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -d -r1.10 -r1.11
> --- tjc_main.c	28 Jan 2009 22:31:01 -0000	1.10
> +++ tjc_main.c	29 Jan 2009 22:33:16 -0000	1.11
> @@ -121,20 +121,6 @@
>      }
>  }
>  
> -void free_tree(TJptree_t *ptree)
> -{
> -    int c;
> -    TJpnode_t *n;
> -    for (c = 0; c < ptree->length; c++) {
> -	n = &ptree->node[c];
> -	if (n->kind == p_query)
> -	    TJCfree (n->sem.qnode);
> -	if (n->kind == p_tag && strcmp (n->sem.str, "*"))
> -	    TJCfree (n->sem.str);
> -    }
> -    TJCfree (ptree);
> -}
> -
>  /* THE NEW STUFF  */
>  
>  tjc_config* tjc_c_GLOBAL;
> @@ -334,7 +320,8 @@
>  	if (DEBUG) stream_printf(GDKout,"#!tjc start of mil:\n%s",milres);
>  	if (DEBUG) stream_printf(GDKout,"#!tjc end of mil\n");
>  	
> -	free_tree(ptree);
> +	free_atree (atree);
> +	tjcp_freetree (ptree);
>      }
>      else {
>  	*errBUFF = GDKstrdup(tjc_c->errBUFF);
> 
> U tjc_phys_optimize.h
> Index: tjc_phys_optimize.h
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_phys_optimize.h,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -d -r1.1 -r1.2
> --- tjc_phys_optimize.h	28 Jan 2009 22:31:01 -0000	1.1
> +++ tjc_phys_optimize.h	29 Jan 2009 22:33:16 -0000	1.2
> @@ -86,6 +86,9 @@
>  phys_optimize(TJptree_t *ptree, TJpnode_t *proot, BAT* rtagbat);
>  
>  extern void
> +free_atree(TJatree_t *atree);
> +
> +extern void
>  printTJatree(tjc_config *tjc_c, TJatree_t *atree);
>  
>  #endif  /* PYHS_OPTIMIZE_H */
> 
> U tjc_phys_optimize.c
> Index: tjc_phys_optimize.c
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_phys_optimize.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -d -r1.3 -r1.4
> --- tjc_phys_optimize.c	29 Jan 2009 20:30:05 -0000	1.3
> +++ tjc_phys_optimize.c	29 Jan 2009 22:33:16 -0000	1.4
> @@ -123,6 +123,11 @@
>      return atree;
>  } 
>  
> +void free_atree (TJatree_t *atree) {
> +    TJCfree (atree->nodes);
> +    TJCfree (atree);
> +}
> +
>  TJanode_t* pnode2anode (TJatree_t *atree, TJpnode_t *s, TJpnode_t *pnode, short *nt)
>  {
>      TJanode_t *anode;
> 
> U tjc_parse.y
> Index: tjc_parse.y
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_parse.y,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -d -r1.5 -r1.6
> --- tjc_parse.y	28 Jan 2009 22:31:01 -0000	1.5
> +++ tjc_parse.y	29 Jan 2009 22:33:16 -0000	1.6
> @@ -145,7 +145,7 @@
>         			  { $$ = $1; $$->root = tjcp_wire2 (tjc_tree, p_pred, $1->root, $2); }
>  	      		| Path PathNoPred PredicateList
>         			  { $$ = $1; *($2->fixme) = $1->root;
> -			    $$->root = tjcp_wire2 (tjc_tree, p_pred, $2->root, $3); }
> +			    $$->root = tjcp_wire2 (tjc_tree, p_pred, $2->root, $3); TJCfree($2); }
>  			;
>  OptPathNoPred		: /* empty */ 
>  	       		  { $$ = NULL; }
> 
> U tjc_abssyn.c
> Index: tjc_abssyn.c
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_abssyn.c,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -d -r1.4 -r1.5
> --- tjc_abssyn.c	28 Jan 2009 22:31:01 -0000	1.4
> +++ tjc_abssyn.c	29 Jan 2009 22:33:16 -0000	1.5
> @@ -48,7 +48,6 @@
>      TJpnode_t *n = NULL;
>      int c;
>  
> -    //n = (TJpnode_t *) TJCmalloc (sizeof (TJpnode_t));
>      if (t->length < t->capacity) 
>  	n = &(t->node[t->length++]);
>      else
> @@ -170,6 +169,20 @@
>      return ptree;
>  }
>  
> +void tjcp_freetree(TJptree_t *ptree)
> +{
> +    int c;
> +    TJpnode_t *n;
> +    for (c = 0; c < ptree->length; c++) {
> +	n = &ptree->node[c];
> +	if (n->kind == p_query)
> +	    TJCfree (n->sem.qnode);
> +	if (n->kind == p_tag && strcmp (n->sem.str, "*"))
> +	    TJCfree (n->sem.str);
> +    }
> +    TJCfree (ptree);
> +}
> +
>  /**
>   * Allocates enough memory to hold a copy of @a str
>   * and return a pointer to this copy
> 
> U tjc_abssyn.h
> Index: tjc_abssyn.h
> ===================================================================
> RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/tjc/tjc_abssyn.h,v
> retrieving revision 1.6
> retrieving revision 1.7
> diff -u -d -r1.6 -r1.7
> --- tjc_abssyn.h	28 Jan 2009 22:31:01 -0000	1.6
> +++ tjc_abssyn.h	29 Jan 2009 22:33:16 -0000	1.7
> @@ -160,6 +160,9 @@
>  extern struct TJptree_t *
>  tjcp_inittree (void);
>  
> +extern void 
> +tjcp_freetree (TJptree_t *ptree);
> +
>  extern char *
>  TJstrndup (const char *str);
>  
> 
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Monetdb-pf-checkins mailing list
> Monetdb-pf-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins


-- 
Sjoerd Mullender

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 369 bytes
Desc: OpenPGP digital signature
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20090130/7eea7e92/attachment.sig>


More information about the developers-list mailing list