mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* include/ruby/ruby.h (rb_data_type_struct): constified dsize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
85cc4ff62a
commit
b46cd0e400
8 changed files with 18 additions and 14 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Sep 9 11:11:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (rb_data_type_struct): constified dsize.
|
||||
|
||||
Wed Sep 9 11:07:48 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* cont.c (cont_memsize): fixed wrong expression on IA64.
|
||||
|
|
|
@ -53,7 +53,7 @@ void rb_enc_init(void);
|
|||
static int load_encoding(const char *name);
|
||||
|
||||
static size_t
|
||||
enc_memsize(void *p)
|
||||
enc_memsize(const void *p)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -740,7 +740,7 @@ typedef struct rb_data_type_struct {
|
|||
const char *wrap_struct_name;
|
||||
void (*dmark)(void*);
|
||||
void (*dfree)(void*);
|
||||
size_t (*dsize)(void *);
|
||||
size_t (*dsize)(const void *);
|
||||
void *ary[4]; /* for extension */
|
||||
} rb_data_type_t;
|
||||
|
||||
|
|
4
iseq.c
4
iseq.c
|
@ -116,10 +116,10 @@ iseq_mark(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
iseq_memsize(void *ptr)
|
||||
iseq_memsize(const void *ptr)
|
||||
{
|
||||
size_t size = sizeof(rb_iseq_t);
|
||||
rb_iseq_t *iseq;
|
||||
const rb_iseq_t *iseq;
|
||||
|
||||
if (ptr) {
|
||||
iseq = ptr;
|
||||
|
|
2
parse.y
2
parse.y
|
@ -9745,7 +9745,7 @@ parser_free(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
parser_memsize(void *ptr)
|
||||
parser_memsize(const void *ptr)
|
||||
{
|
||||
struct parser_params *p = (struct parser_params*)ptr;
|
||||
struct local_vars *local;
|
||||
|
|
6
proc.c
6
proc.c
|
@ -62,7 +62,7 @@ proc_mark(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
proc_memsize(void *ptr)
|
||||
proc_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? sizeof(rb_proc_t) : 0;
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ binding_mark(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
binding_memsize(void *ptr)
|
||||
binding_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? sizeof(rb_binding_t) : 0;
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ bm_free(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
bm_memsize(void *ptr)
|
||||
bm_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? sizeof(struct METHOD) : 0;
|
||||
}
|
||||
|
|
2
random.c
2
random.c
|
@ -315,7 +315,7 @@ random_mark(void *ptr)
|
|||
#define random_free RUBY_TYPED_DEFAULT_FREE
|
||||
|
||||
static size_t
|
||||
random_memsize(void *ptr)
|
||||
random_memsize(const void *ptr)
|
||||
{
|
||||
return ptr ? sizeof(rb_random_t) : 0;
|
||||
}
|
||||
|
|
10
vm.c
10
vm.c
|
@ -225,7 +225,7 @@ env_free(void * const ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
env_memsize(void *ptr)
|
||||
env_memsize(const void *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
const rb_env_t * const env = ptr;
|
||||
|
@ -1482,10 +1482,10 @@ vm_free(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
vm_memsize(void *ptr)
|
||||
vm_memsize(const void *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
rb_vm_t *vmobj = ptr;
|
||||
const rb_vm_t *vmobj = ptr;
|
||||
return sizeof(rb_vm_t) + st_memsize(vmobj->living_threads);
|
||||
}
|
||||
else {
|
||||
|
@ -1658,12 +1658,12 @@ thread_free(void *ptr)
|
|||
}
|
||||
|
||||
static size_t
|
||||
thread_memsize(void *ptr)
|
||||
thread_memsize(const void *ptr)
|
||||
{
|
||||
RUBY_FREE_ENTER("thread");
|
||||
|
||||
if (ptr) {
|
||||
rb_thread_t *th = ptr;
|
||||
const rb_thread_t *th = ptr;
|
||||
size_t size = sizeof(rb_thread_t);
|
||||
|
||||
if (!th->root_fiber) {
|
||||
|
|
Loading…
Reference in a new issue