Commit 05d47bd5 authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka
Browse files

Linpool: default allocation size

parent b880e3ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ struct config *
config_alloc(const char *name)
{
  pool *p = rp_new(&root_pool, "Config");
  linpool *l = lp_new(p, 4080);
  linpool *l = lp_new_default(p);
  struct config *c = lp_allocz(l, sizeof(struct config));

  /* Duplication of name string in local linear pool */
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ run_function(const void *parsed_fn_def)
  /* XXX: const -> non-const */
  struct f_inst *f = (struct f_inst *) parsed_fn_def;

  linpool *tmp = lp_new(&root_pool, 4096);
  linpool *tmp = lp_new_default(&root_pool);
  struct f_val res = f_eval(f, tmp);
  rfree(tmp);

+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ start_conf_env(void)
  bt_bird_init();

  pool *p = rp_new(&root_pool, "helper_pool");
  linpool *l = lp_new(p, 4080);
  linpool *l = lp_new_default(p);
  cfg_mem = l;
}

+2 −2
Original line number Diff line number Diff line
@@ -401,7 +401,7 @@ t_builder4(void)
  resource_init();

  struct flow_builder *fb = flow_builder_init(&root_pool);
  linpool *lp = lp_new(&root_pool, 4096);
  linpool *lp = lp_new_default(&root_pool);

  /* Expectation */

@@ -482,7 +482,7 @@ t_builder6(void)
  net_addr_ip6 ip;

  resource_init();
  linpool *lp = lp_new(&root_pool, 4096);
  linpool *lp = lp_new_default(&root_pool);
  struct flow_builder *fb = flow_builder_init(&root_pool);
  fb->ipv6 = 1;

+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ struct lp_chunk {
  byte data[0];
};

const int lp_chunk_size = sizeof(struct lp_chunk);

struct linpool {
  resource r;
  byte *ptr, *end;
Loading