Skip to content

Commit

Permalink
Distinct long-link table growth log message
Browse files Browse the repository at this point in the history
* finalize.c (GC_register_disappearing_link_inner): Add tbl_log_name
argument and pass it to GC_COND_LOG_PRINTF (instead of "dl" name).
* finalize.c (GC_general_register_disappearing_link,
GC_register_long_link): Pass corresponding link hashtable short name
("dl" or "long dl") to GC_register_disappearing_link_inner.
  • Loading branch information
ivmai committed Aug 4, 2015
1 parent fceb4a4 commit aa1eb05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions finalize.c
Expand Up @@ -146,7 +146,7 @@ GC_API int GC_CALL GC_register_disappearing_link(void * * link)

STATIC int GC_register_disappearing_link_inner(
struct dl_hashtbl_s *dl_hashtbl, void **link,
const void *obj)
const void *obj, const char *tbl_log_name)
{
struct disappearing_link *curr_dl;
size_t index;
Expand All @@ -159,7 +159,7 @@ STATIC int GC_register_disappearing_link_inner(
|| dl_hashtbl -> entries > ((word)1 << dl_hashtbl -> log_size)) {
GC_grow_table((struct hash_chain_entry ***)&dl_hashtbl -> head,
&dl_hashtbl -> log_size);
GC_COND_LOG_PRINTF("Grew dl table to %u entries\n",
GC_COND_LOG_PRINTF("Grew %s table to %u entries\n", tbl_log_name,
1 << (unsigned)dl_hashtbl -> log_size);
}
index = HASH2(link, dl_hashtbl -> log_size);
Expand Down Expand Up @@ -213,7 +213,8 @@ GC_API int GC_CALL GC_general_register_disappearing_link(void * * link,
{
if (((word)link & (ALIGNMENT-1)) != 0 || NULL == link)
ABORT("Bad arg to GC_general_register_disappearing_link");
return GC_register_disappearing_link_inner(&GC_dl_hashtbl, link, obj);
return GC_register_disappearing_link_inner(&GC_dl_hashtbl, link, obj,
"dl");
}

#ifdef DBG_HDRS_ALL
Expand Down Expand Up @@ -291,7 +292,8 @@ GC_API GC_await_finalize_proc GC_CALL GC_get_await_finalize_proc(void)
{
if (((word)link & (ALIGNMENT-1)) != 0 || NULL == link)
ABORT("Bad arg to GC_register_long_link");
return GC_register_disappearing_link_inner(&GC_ll_hashtbl, link, obj);
return GC_register_disappearing_link_inner(&GC_ll_hashtbl, link, obj,
"long dl");
}

GC_API int GC_CALL GC_unregister_long_link(void * * link)
Expand Down

0 comments on commit aa1eb05

Please sign in to comment.