Branch: Tag:

2019-11-14

2019-11-14 12:15:53 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: count_memory_in_node_ss() now survives Pike_compiler_base.

Pike_compiler_base has no active compiler.

Also adds some PIKE_DEBUG checks.

465:   void init_node_s_blocks() { }      void really_free_node_s(node * n) { + #ifdef PIKE_DEBUG +  if (!Pike_compiler->compiler) { +  Pike_fatal("Attempt to free a node with no active compiler.\n"); +  } + #endif    ba_free(&Pike_compiler->compiler->node_allocator, n);   }      MALLOC_FUNCTION   node * alloc_node_s() { -  + #ifdef PIKE_DEBUG +  if (!Pike_compiler->compiler) { +  Pike_fatal("Attempt to allocate a node with no active compiler.\n"); +  } + #endif    return ba_alloc(&Pike_compiler->compiler->node_allocator);   }   
480:    *size = 0;       while (state) { +  /* NB: Pike_compiler_base has no active compiler. */ +  if (state->compiler) {    size_t _num, _size;    ba_count_all(&state->compiler->node_allocator, &_num, &_size);    *num += _num;    *size += _size; -  +  }    state = state->previous;    }   }