зеркало из https://github.com/github/ruby.git
* ext/**/*.c (*_memsize): same as r52986 for extensions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e76567c15b
Коммит
dff42b0ea0
|
@ -1,3 +1,7 @@
|
|||
Wed Dec 9 09:58:09 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* ext/**/*.c (*_memsize): same as r52986 for extensions.
|
||||
|
||||
Wed Dec 9 09:46:19 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* .gitignore: ignored ISeq binary format.
|
||||
|
|
|
@ -10,7 +10,7 @@ numhash_free(void *ptr)
|
|||
static size_t
|
||||
numhash_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? st_memsize(ptr) : 0;
|
||||
return st_memsize(ptr);
|
||||
}
|
||||
|
||||
static const rb_data_type_t numhash_type = {
|
||||
|
|
|
@ -172,7 +172,7 @@ static size_t
|
|||
BigDecimal_memsize(const void *ptr)
|
||||
{
|
||||
const Real *pv = ptr;
|
||||
return pv ? (sizeof(*pv) + pv->MaxPrec * sizeof(BDIGIT)) : 0;
|
||||
return (sizeof(*pv) + pv->MaxPrec * sizeof(BDIGIT));
|
||||
}
|
||||
|
||||
static const rb_data_type_t BigDecimal_data_type = {
|
||||
|
|
|
@ -41,14 +41,13 @@ closure_memsize(const void * ptr)
|
|||
fiddle_closure * cls = (fiddle_closure *)ptr;
|
||||
size_t size = 0;
|
||||
|
||||
if (ptr) {
|
||||
size += sizeof(*cls);
|
||||
size += sizeof(*cls);
|
||||
#if !defined(FFI_NO_RAW_API) || !FFI_NO_RAW_API
|
||||
size += ffi_raw_size(&cls->cif);
|
||||
size += ffi_raw_size(&cls->cif);
|
||||
#endif
|
||||
size += sizeof(*cls->argv);
|
||||
size += sizeof(ffi_closure);
|
||||
}
|
||||
size += sizeof(*cls->argv);
|
||||
size += sizeof(ffi_closure);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,12 +38,11 @@ function_memsize(const void *p)
|
|||
/* const */ffi_cif *ptr = (ffi_cif *)p;
|
||||
size_t size = 0;
|
||||
|
||||
if (ptr) {
|
||||
size += sizeof(*ptr);
|
||||
size += sizeof(*ptr);
|
||||
#if !defined(FFI_NO_RAW_API) || !FFI_NO_RAW_API
|
||||
size += ffi_raw_size(ptr);
|
||||
size += ffi_raw_size(ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ fiddle_handle_free(void *ptr)
|
|||
static size_t
|
||||
fiddle_handle_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? sizeof(struct dl_handle) : 0;
|
||||
return sizeof(struct dl_handle);
|
||||
}
|
||||
|
||||
static const rb_data_type_t fiddle_handle_data_type = {
|
||||
|
|
|
@ -72,7 +72,7 @@ static size_t
|
|||
fiddle_ptr_memsize(const void *ptr)
|
||||
{
|
||||
const struct ptr_data *data = ptr;
|
||||
return data ? sizeof(*data) + data->size : 0;
|
||||
return sizeof(*data) + data->size;
|
||||
}
|
||||
|
||||
static const rb_data_type_t fiddle_ptr_data_type = {
|
||||
|
|
|
@ -91,7 +91,7 @@ static size_t
|
|||
ossl_cipher_memsize(const void *ptr)
|
||||
{
|
||||
const EVP_CIPHER_CTX *ctx = ptr;
|
||||
return ctx ? sizeof(*ctx) : 0;
|
||||
return sizeof(*ctx);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -62,8 +62,6 @@ ifaddr_memsize(const void *ptr)
|
|||
{
|
||||
const rb_ifaddr_t *ifaddr;
|
||||
const rb_ifaddr_root_t *root;
|
||||
if (ptr == NULL)
|
||||
return 0;
|
||||
ifaddr = ptr;
|
||||
root = get_root(ifaddr);
|
||||
return sizeof(rb_ifaddr_root_t) + (root->numifaddrs - 1) * sizeof(rb_ifaddr_t);
|
||||
|
|
|
@ -725,7 +725,7 @@ addrinfo_mark(void *ptr)
|
|||
static size_t
|
||||
addrinfo_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? sizeof(rb_addrinfo_t) : 0;
|
||||
return sizeof(rb_addrinfo_t);
|
||||
}
|
||||
|
||||
static const rb_data_type_t addrinfo_type = {
|
||||
|
|
|
@ -67,7 +67,6 @@ static size_t
|
|||
strio_memsize(const void *p)
|
||||
{
|
||||
const struct StringIO *ptr = p;
|
||||
if (!ptr) return 0;
|
||||
return sizeof(struct StringIO);
|
||||
}
|
||||
|
||||
|
|
|
@ -181,11 +181,7 @@ static size_t
|
|||
strscan_memsize(const void *ptr)
|
||||
{
|
||||
const struct strscanner *p = ptr;
|
||||
size_t size = 0;
|
||||
if (p) {
|
||||
size = sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
|
||||
}
|
||||
return size;
|
||||
return sizeof(*p) - sizeof(p->regs) + onig_region_memsize(&p->regs);
|
||||
}
|
||||
|
||||
static const rb_data_type_t strscanner_type = {
|
||||
|
|
|
@ -3872,7 +3872,7 @@ static size_t
|
|||
com_hash_size(const void *ptr)
|
||||
{
|
||||
const st_table *tbl = ptr;
|
||||
return tbl ? st_memsize(tbl) : 0;
|
||||
return st_memsize(tbl);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче