pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:397:    }    }    return 1;   }      #undef BLOCK_ALLOC_NEXT   #define BLOCK_ALLOC_NEXT u.node.a      #undef PRE_INIT_BLOCK   #define PRE_INIT_BLOCK(NODE) do { \ -  NODE->token = USHRT_MAX; \ +  (NODE)->token = USHRT_MAX; \    } while (0)      BLOCK_ALLOC_FILL_PAGES(node_s, 2)    - #define NODES (sizeof (((struct node_s_block *) NULL)->x) / sizeof (struct node_s)) -  +    #undef BLOCK_ALLOC_NEXT   #define BLOCK_ALLOC_NEXT next      void free_all_nodes(void)   {    if(!Pike_compiler->previous)    {    node *tmp; -  struct node_s_block *tmp2; -  size_t e=0; +       #ifndef PIKE_DEBUG -  if(cumulative_parse_error) -  { +  if(cumulative_parse_error) { + #else +  size_t e=0, s=0; +  count_memory_in_node_ss(&e, &s); +  if(e) {   #endif -  -  for(tmp2=node_s_blocks;tmp2;tmp2=tmp2->next) e+=tmp2->used; -  if(e) -  { -  size_t e2=e; -  struct node_s_block *nextblk; -  for(tmp2=node_s_blocks;tmp2;tmp2=nextblk) -  { -  int n = tmp2->used; -  nextblk = tmp2->next; -  /* We want to be able to access the token field of all -  * the blocks... -  */ -  PIKE_MEM_RW(tmp2->x); -  for(e=0;n && e<NODES;e++) -  { -  if (tmp2->x[e].token != USHRT_MAX) -  { -  tmp=tmp2->x+e; +  WALK_NONFREE_BLOCKS(node_s, tmp, tmp->token != USHRT_MAX, {   #ifdef PIKE_DEBUG    if(!cumulative_parse_error)    {    fprintf(stderr,"Free node at %p, (%s:%ld) (token=%d).\n",    (void *)tmp,    tmp->current_file->str, (long)tmp->line_number,    tmp->token);       debug_malloc_dump_references(tmp,0,2,0);   
pike.git/src/las.c:468: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if (l_flag > 3) {    fprintf(stderr, "Freeing node that had %d refs.\n",    tmp->refs);    }   #endif /* PIKE_DEBUG */    /* Force the node to be freed. */    tmp->refs = 1;    debug_malloc_touch(tmp->type);    free_node(tmp); -  --n; +     } -  } -  } -  } +  });   #ifdef PIKE_DEBUG    if(!cumulative_parse_error) -  Pike_fatal("Failed to free %"PRINTSIZET"d nodes when compiling!\n",e2); - #endif +  Pike_fatal("Failed to free %"PRINTSIZET"d nodes when compiling!\n",e);    } - #ifndef PIKE_DEBUG + #else    }   #endif    free_all_node_s_blocks();    cumulative_parse_error=0;    }   }      void debug_free_node(node *n)   {    if(!n) return;