зеркало из https://github.com/github/ruby.git
* compile.c (ibf_dump_memsize): should check NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
4466d4baa9
Коммит
e78bf7976c
|
@ -1,3 +1,7 @@
|
|||
Wed Dec 9 02:18:52 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* compile.c (ibf_dump_memsize): should check NULL.
|
||||
|
||||
Wed Dec 9 01:46:35 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_init): now accepts new option parameter `encoding'.
|
||||
|
|
15
compile.c
15
compile.c
|
@ -8054,11 +8054,16 @@ ibf_dump_free(void *ptr)
|
|||
static size_t
|
||||
ibf_dump_memsize(const void *ptr)
|
||||
{
|
||||
struct ibf_dump *dump = (struct ibf_dump *)ptr;
|
||||
size_t size = sizeof(*dump);
|
||||
if (dump->iseq_table) size += st_memsize(dump->iseq_table);
|
||||
if (dump->id_table) size += st_memsize(dump->id_table);
|
||||
return size;
|
||||
if (ptr) {
|
||||
struct ibf_dump *dump = (struct ibf_dump *)ptr;
|
||||
size_t size = sizeof(*dump);
|
||||
if (dump->iseq_table) size += st_memsize(dump->iseq_table);
|
||||
if (dump->id_table) size += st_memsize(dump->id_table);
|
||||
return size;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static const rb_data_type_t ibf_dump_type = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче