mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* id_table.c: IMPL() macro accept op as _opname instead of opname
because jemalloc seems to replace the word `free' to `je_free'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e514914919
commit
1761312577
2 changed files with 16 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Aug 12 21:57:31 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* id_table.c: IMPL() macro accept op as _opname instead of opname
|
||||
because jemalloc seems to replace the word `free' to `je_free'.
|
||||
|
||||
Wed Aug 12 21:51:11 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* id_table.c (mix_id_table_insert): fix memory leak.
|
||||
|
|
22
id_table.c
22
id_table.c
|
@ -1503,24 +1503,24 @@ mix_id_table_foreach_values(struct mix_id_table *tbl, enum rb_id_table_iterator_
|
|||
#endif /* ID_TABLE_USE_MIX */
|
||||
|
||||
/* IMPL(create) will be "hash_id_table_create" and so on */
|
||||
#define IMPL2(name, op) name##_id_table_##op
|
||||
#define IMPL2(name, op) name##_id_table##op
|
||||
#define IMPL1(name, op) IMPL2(name, op)
|
||||
#define IMPL(op) IMPL1(ID_TABLE_NAME, op)
|
||||
|
||||
struct rb_id_table *rb_id_table_create(size_t size) {return (struct rb_id_table *)IMPL(create)(size);}
|
||||
void rb_id_table_free(struct rb_id_table *tbl) { IMPL(free)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
void rb_id_table_clear(struct rb_id_table *tbl) { IMPL(clear)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
size_t rb_id_table_size(struct rb_id_table *tbl) {return IMPL(size)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
size_t rb_id_table_memsize(struct rb_id_table *tbl) {return IMPL(memsize)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
struct rb_id_table *rb_id_table_create(size_t size) {return (struct rb_id_table *)IMPL(_create)(size);}
|
||||
void rb_id_table_free(struct rb_id_table *tbl) { IMPL(_free)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
void rb_id_table_clear(struct rb_id_table *tbl) { IMPL(_clear)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
size_t rb_id_table_size(struct rb_id_table *tbl) {return IMPL(_size)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
size_t rb_id_table_memsize(struct rb_id_table *tbl) {return IMPL(_memsize)((ID_TABLE_IMPL_TYPE *)tbl);}
|
||||
|
||||
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val) {return IMPL(insert)((ID_TABLE_IMPL_TYPE *)tbl, id, val);}
|
||||
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp) {return IMPL(lookup)((ID_TABLE_IMPL_TYPE *)tbl, id, valp);}
|
||||
int rb_id_table_delete(struct rb_id_table *tbl, ID id) {return IMPL(delete)((ID_TABLE_IMPL_TYPE *)tbl, id);}
|
||||
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val) {return IMPL(_insert)((ID_TABLE_IMPL_TYPE *)tbl, id, val);}
|
||||
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp) {return IMPL(_lookup)((ID_TABLE_IMPL_TYPE *)tbl, id, valp);}
|
||||
int rb_id_table_delete(struct rb_id_table *tbl, ID id) {return IMPL(_delete)((ID_TABLE_IMPL_TYPE *)tbl, id);}
|
||||
|
||||
void rb_id_table_foreach(struct rb_id_table *tbl, enum rb_id_table_iterator_result (*func)(ID id, VALUE val, void *data), void *data) {
|
||||
IMPL(foreach)((ID_TABLE_IMPL_TYPE *)tbl, func, data);}
|
||||
IMPL(_foreach)((ID_TABLE_IMPL_TYPE *)tbl, func, data);}
|
||||
void rb_id_table_foreach_values(struct rb_id_table *tbl, enum rb_id_table_iterator_result (*func)(VALUE val, void *data), void *data) {
|
||||
IMPL(foreach_values)((ID_TABLE_IMPL_TYPE *)tbl, func, data);}
|
||||
IMPL(_foreach_values)((ID_TABLE_IMPL_TYPE *)tbl, func, data);}
|
||||
|
||||
#if ID_TABLE_STARTUP_SIG
|
||||
__attribute__((constructor))
|
||||
|
|
Loading…
Reference in a new issue