* compile.c: constify the first parameter (iseq).

* iseq_add_mark_object()
  * iseq_add_mark_object_compile_time()
* iseq.c, iseq.h (rb_iseq_add_mark_object): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2015-07-21 10:47:45 +00:00
parent 04b7a80131
commit c0c20ccb51
4 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,11 @@
Tue Jul 21 19:43:20 2015 Koichi Sasada <ko1@atdot.net>
* compile.c: constify the first parameter (iseq).
* iseq_add_mark_object()
* iseq_add_mark_object_compile_time()
* iseq.c, iseq.h (rb_iseq_add_mark_object): ditto.
Tue Jul 21 16:18:48 2015 Eric Wong <e@80x24.org> Tue Jul 21 16:18:48 2015 Eric Wong <e@80x24.org>
* test/socket/test_nonblock.rb: increase buffer sizes * test/socket/test_nonblock.rb: increase buffer sizes

View File

@ -422,7 +422,7 @@ APPEND_ELEM(ISEQ_ARG_DECLARE LINK_ANCHOR *anchor, LINK_ELEMENT *before, LINK_ELE
#endif #endif
static int static int
iseq_add_mark_object(rb_iseq_t *iseq, VALUE v) iseq_add_mark_object(const rb_iseq_t *iseq, VALUE v)
{ {
if (!SPECIAL_CONST_P(v)) { if (!SPECIAL_CONST_P(v)) {
rb_iseq_add_mark_object(iseq, v); rb_iseq_add_mark_object(iseq, v);
@ -433,7 +433,7 @@ iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
#define ruby_sourcefile RSTRING_PTR(iseq->location.path) #define ruby_sourcefile RSTRING_PTR(iseq->location.path)
static int static int
iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v) iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v)
{ {
if (!SPECIAL_CONST_P(v)) { if (!SPECIAL_CONST_P(v)) {
rb_ary_push(iseq->compile_data->mark_ary, v); rb_ary_push(iseq->compile_data->mark_ary, v);

2
iseq.c
View File

@ -229,7 +229,7 @@ set_relation(rb_iseq_t *iseq, const VALUE parent)
} }
void void
rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj) rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj)
{ {
if (!RTEST(iseq->mark_ary)) { if (!RTEST(iseq->mark_ary)) {
RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, rb_ary_tmp_new(3)); RB_OBJ_WRITE(iseq->self, &iseq->mark_ary, rb_ary_tmp_new(3));

2
iseq.h
View File

@ -23,7 +23,7 @@ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
VALUE exception, VALUE body); VALUE exception, VALUE body);
/* iseq.c */ /* iseq.c */
void rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj); void rb_iseq_add_mark_object(const rb_iseq_t *iseq, VALUE obj);
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt); VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc); VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
struct st_table *ruby_insn_make_insn_table(void); struct st_table *ruby_insn_make_insn_table(void);