/** * Initialize the leak accumulator by "file:line" */ leak_set_t * leak_init(void) { struct leak_set *ls; XMALLOC0(ls); ls->magic = LEAK_SET_MAGIC; ls->places = htable_create_real(HASH_KEY_STRING, 0); /* No walloc() */ ls->stacks = htable_create_any_real(stack_hash, NULL, stack_eq); return ls; }
/** * Initialze a BFD symbol lookup environment context. * * @return new context that will need to be closed with bfd_util_close_null(). */ bfd_env_t * bfd_util_init(void) { static once_flag_t done; bfd_env_t *be; XMALLOC0(be); be->magic = BFD_ENV_MAGIC; mutex_init(&be->lock); ONCE_FLAG_RUN(done, bfd_init); return be; }