[前][次][番号順一覧][スレッド一覧]

ruby-changes:51165

From: mame <ko1@a...>
Date: Wed, 9 May 2018 16:12:04 +0900 (JST)
Subject: [ruby-changes:51165] mame:r63372 (trunk): Rename imemo_alloc with imemo_tmpbuf

mame	2018-05-09 16:11:59 +0900 (Wed, 09 May 2018)

  New Revision: 63372

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63372

  Log:
    Rename imemo_alloc with imemo_tmpbuf

  Modified files:
    trunk/ext/objspace/objspace.c
    trunk/ext/objspace/objspace_dump.c
    trunk/gc.c
    trunk/internal.h
    trunk/parse.y
Index: ext/objspace/objspace.c
===================================================================
--- ext/objspace/objspace.c	(revision 63371)
+++ ext/objspace/objspace.c	(revision 63372)
@@ -625,7 +625,7 @@ count_imemo_objects(int argc, VALUE *arg https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace.c#L625
 	imemo_type_ids[5] = rb_intern("imemo_memo");
 	imemo_type_ids[6] = rb_intern("imemo_ment");
 	imemo_type_ids[7] = rb_intern("imemo_iseq");
-	imemo_type_ids[8] = rb_intern("imemo_alloc");
+	imemo_type_ids[8] = rb_intern("imemo_tmpbuf");
 	imemo_type_ids[9] = rb_intern("imemo_parser_strterm");
     }
 
Index: ext/objspace/objspace_dump.c
===================================================================
--- ext/objspace/objspace_dump.c	(revision 63371)
+++ ext/objspace/objspace_dump.c	(revision 63372)
@@ -205,7 +205,7 @@ imemo_name(int imemo) https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace_dump.c#L205
 	TYPE_STR(memo);
 	TYPE_STR(ment);
 	TYPE_STR(iseq);
-	TYPE_STR(alloc);
+	TYPE_STR(tmpbuf);
 	TYPE_STR(ast);
 	TYPE_STR(parser_strterm);
       default:
Index: gc.c
===================================================================
--- gc.c	(revision 63371)
+++ gc.c	(revision 63372)
@@ -434,7 +434,7 @@ typedef struct RVALUE { https://github.com/ruby/ruby/blob/trunk/gc.c#L434
 	    struct rb_method_entry_struct ment;
 	    const rb_iseq_t iseq;
 	    rb_env_t env;
-	    struct rb_imemo_alloc_struct alloc;
+	    struct rb_imemo_tmpbuf_struct alloc;
 	    rb_ast_t ast;
 	} imemo;
 	struct {
@@ -2025,28 +2025,28 @@ rb_imemo_new(enum imemo_type type, VALUE https://github.com/ruby/ruby/blob/trunk/gc.c#L2025
 }
 
 static VALUE
-rb_imemo_alloc_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
+rb_imemo_tmpbuf_new(VALUE v1, VALUE v2, VALUE v3, VALUE v0)
 {
-    VALUE flags = T_IMEMO | (imemo_alloc << FL_USHIFT);
+    VALUE flags = T_IMEMO | (imemo_tmpbuf << FL_USHIFT);
     return newobj_of(v0, flags, v1, v2, v3, FALSE);
 }
 
 VALUE
-rb_imemo_alloc_auto_free_pointer(void *buf)
+rb_imemo_tmpbuf_auto_free_pointer(void *buf)
 {
-    return rb_imemo_new(imemo_alloc, (VALUE)buf, 0, 0, 0);
+    return rb_imemo_new(imemo_tmpbuf, (VALUE)buf, 0, 0, 0);
 }
 
 VALUE
-rb_imemo_alloc_auto_free_maybe_mark_buffer(void *buf, size_t cnt)
+rb_imemo_tmpbuf_auto_free_maybe_mark_buffer(void *buf, size_t cnt)
 {
-    return rb_imemo_alloc_new((VALUE)buf, 0, (VALUE)cnt, 0);
+    return rb_imemo_tmpbuf_new((VALUE)buf, 0, (VALUE)cnt, 0);
 }
 
-rb_imemo_alloc_t *
-rb_imemo_alloc_parser_heap(void *buf, rb_imemo_alloc_t *old_heap, size_t cnt)
+rb_imemo_tmpbuf_t *
+rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt)
 {
-    return (rb_imemo_alloc_t *)rb_imemo_alloc_new((VALUE)buf, (VALUE)old_heap, (VALUE)cnt, 0);
+    return (rb_imemo_tmpbuf_t *)rb_imemo_tmpbuf_new((VALUE)buf, (VALUE)old_heap, (VALUE)cnt, 0);
 }
 
 #if IMEMO_DEBUG
@@ -2382,7 +2382,7 @@ obj_free(rb_objspace_t *objspace, VALUE https://github.com/ruby/ruby/blob/trunk/gc.c#L2382
 	    GC_ASSERT(VM_ENV_ESCAPED_P(RANY(obj)->as.imemo.env.ep));
 	    xfree((VALUE *)RANY(obj)->as.imemo.env.env);
 	    break;
-	  case imemo_alloc:
+	  case imemo_tmpbuf:
 	    xfree(RANY(obj)->as.imemo.alloc.ptr);
 	    break;
 	  case imemo_ast:
@@ -3308,7 +3308,7 @@ obj_memsize_of(VALUE obj, int use_all_ty https://github.com/ruby/ruby/blob/trunk/gc.c#L3308
       case T_RATIONAL:
       case T_COMPLEX:
       case T_IMEMO:
-	if (imemo_type_p(obj, imemo_alloc)) {
+	if (imemo_type_p(obj, imemo_tmpbuf)) {
 	    size += RANY(obj)->as.imemo.alloc.cnt * sizeof(VALUE);
 	}
 	break;
@@ -4556,9 +4556,9 @@ gc_mark_imemo(rb_objspace_t *objspace, V https://github.com/ruby/ruby/blob/trunk/gc.c#L4556
       case imemo_iseq:
 	rb_iseq_mark((rb_iseq_t *)obj);
 	return;
-      case imemo_alloc:
+      case imemo_tmpbuf:
 	{
-	    const rb_imemo_alloc_t *m = &RANY(obj)->as.imemo.alloc;
+	    const rb_imemo_tmpbuf_t *m = &RANY(obj)->as.imemo.alloc;
 	    do {
 		rb_gc_mark_locations(m->ptr, m->ptr + m->cnt);
 	    } while ((m = m->next) != NULL);
@@ -8143,7 +8143,7 @@ rb_alloc_tmp_buffer_with_count(volatile https://github.com/ruby/ruby/blob/trunk/gc.c#L8143
     void *ptr;
 
     ptr = ruby_xmalloc0(size);
-    *store = rb_imemo_alloc_auto_free_maybe_mark_buffer(ptr, cnt);
+    *store = rb_imemo_tmpbuf_auto_free_maybe_mark_buffer(ptr, cnt);
     return ptr;
 }
 
@@ -8162,7 +8162,7 @@ rb_alloc_tmp_buffer(volatile VALUE *stor https://github.com/ruby/ruby/blob/trunk/gc.c#L8162
 void
 rb_free_tmp_buffer(volatile VALUE *store)
 {
-    rb_imemo_alloc_t *s = (rb_imemo_alloc_t*)ATOMIC_VALUE_EXCHANGE(*store, 0);
+    rb_imemo_tmpbuf_t *s = (rb_imemo_tmpbuf_t*)ATOMIC_VALUE_EXCHANGE(*store, 0);
     if (s) {
 	void *ptr = ATOMIC_PTR_EXCHANGE(s->ptr, 0);
 	s->cnt = 0;
@@ -9397,7 +9397,7 @@ rb_raw_obj_info(char *buff, const int bu https://github.com/ruby/ruby/blob/trunk/gc.c#L9397
 		IMEMO_NAME(memo);
 		IMEMO_NAME(ment);
 		IMEMO_NAME(iseq);
-		IMEMO_NAME(alloc);
+		IMEMO_NAME(tmpbuf);
 #undef IMEMO_NAME
 	      default: UNREACHABLE;
 	    }
Index: internal.h
===================================================================
--- internal.h	(revision 63371)
+++ internal.h	(revision 63372)
@@ -864,7 +864,7 @@ enum imemo_type { https://github.com/ruby/ruby/blob/trunk/internal.h#L864
     imemo_memo           =  5,
     imemo_ment           =  6,
     imemo_iseq           =  7,
-    imemo_alloc          =  8,
+    imemo_tmpbuf         =  8,
     imemo_ast            =  9,
     imemo_parser_strterm = 10
 };
@@ -952,17 +952,17 @@ rb_vm_ifunc_proc_new(VALUE (*func)(ANYAR https://github.com/ruby/ruby/blob/trunk/internal.h#L952
     return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
 }
 
-typedef struct rb_imemo_alloc_struct {
+typedef struct rb_imemo_tmpbuf_struct {
     VALUE flags;
     VALUE reserved;
     VALUE *ptr; /* malloc'ed buffer */
-    struct rb_imemo_alloc_struct *next; /* next imemo */
+    struct rb_imemo_tmpbuf_struct *next; /* next imemo */
     size_t cnt; /* buffer size in VALUE */
-} rb_imemo_alloc_t;
+} rb_imemo_tmpbuf_t;
 
-VALUE rb_imemo_alloc_auto_free_pointer(void *buf);
-VALUE rb_imemo_alloc_auto_free_maybe_mark_buffer(void *buf, size_t cnt);
-rb_imemo_alloc_t *rb_imemo_alloc_parser_heap(void *buf, rb_imemo_alloc_t *old_heap, size_t cnt);
+VALUE rb_imemo_tmpbuf_auto_free_pointer(void *buf);
+VALUE rb_imemo_tmpbuf_auto_free_maybe_mark_buffer(void *buf, size_t cnt);
+rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
 
 void rb_strterm_mark(VALUE obj);
 
Index: parse.y
===================================================================
--- parse.y	(revision 63371)
+++ parse.y	(revision 63372)
@@ -183,7 +183,7 @@ typedef struct rb_strterm_struct rb_strt https://github.com/ruby/ruby/blob/trunk/parse.y#L183
                      token
 */
 struct parser_params {
-    rb_imemo_alloc_t *heap;
+    rb_imemo_tmpbuf_t *heap;
 
     YYSTYPE *lval;
 
@@ -2505,7 +2505,7 @@ primary		: literal https://github.com/ruby/ruby/blob/trunk/parse.y#L2505
 			NODE *args, *scope, *internal_var = NEW_DVAR(id, &@2);
 			ID *tbl = ALLOC_N(ID, 2);
 			tbl[0] = 1 /* length of local var table */; tbl[1] = id /* internal id */;
-			add_mark_object(p, rb_imemo_alloc_auto_free_pointer(tbl));
+			add_mark_object(p, rb_imemo_tmpbuf_auto_free_pointer(tbl));
 
 			switch (nd_type($2)) {
 			  case NODE_LASGN:
@@ -9988,7 +9988,7 @@ new_args_tail(struct parser_params *p, N https://github.com/ruby/ruby/blob/trunk/parse.y#L9988
     NODE *node;
 
     args = ZALLOC(struct rb_args_info);
-    add_mark_object(p, rb_imemo_alloc_auto_free_pointer(args));
+    add_mark_object(p, rb_imemo_tmpbuf_auto_free_pointer(args));
     node = NEW_NODE(NODE_ARGS, 0, 0, args, &NULL_LOC);
     if (p->error_p) return node;
 
@@ -10350,7 +10350,7 @@ local_tbl(struct parser_params *p) https://github.com/ruby/ruby/blob/trunk/parse.y#L10350
     if (--j < cnt) REALLOC_N(buf, ID, (cnt = j) + 1);
     buf[0] = cnt;
 
-    add_mark_object(p, rb_imemo_alloc_auto_free_pointer(buf));
+    add_mark_object(p, rb_imemo_tmpbuf_auto_free_pointer(buf));
 
     return buf;
 }
@@ -10975,7 +10975,7 @@ rb_parser_malloc(struct parser_params *p https://github.com/ruby/ruby/blob/trunk/parse.y#L10975
 {
     size_t cnt = HEAPCNT(1, size);
     void *ptr = xmalloc(size);
-    p->heap = rb_imemo_alloc_parser_heap(ptr, p->heap, cnt);
+    p->heap = rb_imemo_tmpbuf_parser_heap(ptr, p->heap, cnt);
     return p->heap->ptr;
 }
 
@@ -10984,14 +10984,14 @@ rb_parser_calloc(struct parser_params *p https://github.com/ruby/ruby/blob/trunk/parse.y#L10984
 {
     size_t cnt = HEAPCNT(nelem, size);
     void *ptr = xcalloc(nelem, size);
-    p->heap = rb_imemo_alloc_parser_heap(ptr, p->heap, cnt);
+    p->heap = rb_imemo_tmpbuf_parser_heap(ptr, p->heap, cnt);
     return p->heap->ptr;
 }
 
 void *
 rb_parser_realloc(struct parser_params *p, void *ptr, size_t size)
 {
-    rb_imemo_alloc_t *n;
+    rb_imemo_tmpbuf_t *n;
     size_t cnt = HEAPCNT(1, size);
 
     if (ptr && (n = p->heap) != NULL) {
@@ -11004,14 +11004,14 @@ rb_parser_realloc(struct parser_params * https://github.com/ruby/ruby/blob/trunk/parse.y#L11004
 	} while ((n = n->next) != NULL);
     }
     ptr = xrealloc(ptr, size);
-    p->heap = rb_imemo_alloc_parser_heap(ptr, p->heap, cnt);
+    p->heap = rb_imemo_tmpbuf_parser_heap(ptr, p->heap, cnt);
     return p->heap->ptr;
 }
 
 void
 rb_parser_free(struct parser_params *p, void *ptr)
 {
-    rb_imemo_alloc_t **prev = &p->heap, *n;
+    rb_imemo_tmpbuf_t **prev = &p->heap, *n;
 
     while ((n = *prev) != NULL) {
 	if (n->ptr == ptr) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]