Example #1
0
EXPORT void ba_show_pages(const struct block_allocator * a) {
    fprintf(stderr, "allocated: %u\n", a->allocated);
    fprintf(stderr, "num_pages: %u\n", a->num_pages);
    fprintf(stderr, "max_empty_pages: %u\n", a->max_empty_pages);
    fprintf(stderr, "empty_pages: %u\n", a->empty_pages);
    fprintf(stderr, "magnitude: %u\n", a->magnitude);
    PRINT_NODE(a, alloc);
    PRINT_LIST(a, pages[0]);
    PRINT_LIST(a, pages[1]);
    PRINT_LIST(a, pages[2]);
    PRINT_NODE(a, last_free);

    /*
     * TODO: we should consider updating alloc/last_free here
     */

    PAGE_LOOP(a, {
	uint32_t blocks_used;
	blocks_used = p->h.used;
	fprintf(stderr, "(%p)\t%f\t(%u %d) --> (prev: %p | next: %p)\n",
		p, blocks_used/(double)a->l.blocks * 100,
		blocks_used,
		blocks_used,
		p->prev, p->next);
    });
Example #2
0
void print(NODE *node, FILE *out)
{
  PRINT_NODE(out, node, "AST_FOR");

  PRINT_EDGE(out, node, S(node).initializer);
  PRINT_EDGE(out, node, S(node).condition);
  if (S(node).increment)
    PRINT_EDGE(out, node, S(node).increment);
  PRINT_EDGE(out, node, S(node).body);
}
Example #3
0
static void print(NODE *node, FILE *out)
{
  PRINT_NODE(out, node, "AST_CALL");
  PRINT_EDGE(out, node, S(node).func);
  PRINT_EDGE(out, node, S(node).args);
}
Example #4
0
static void print(NODE *node, FILE *out)
{
  PRINT_NODE(out, node, "AST_BLOCK");
  PRINT_EDGE(out, node, S(node).declarations);
  PRINT_EDGE(out, node, S(node).statements);
}
Example #5
0
static void print(NODE *node, FILE *out)
{
  PRINT_NODE(out, node, "AST_ARRAY");
  PRINT_EDGE(out, node, S(node).identifier);
  PRINT_EDGE(out, node, S(node).count);
}