[#34261] ComplexFloat — "Kenta Murata" <muraken@...>

村田です.

117 messages 2008/04/06
[#34280] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

村田です.

[#34286] Re: ComplexFloat — Nobuyoshi Nakada <nobu@...> 2008/04/10

なかだです。

[#34288] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34290] Re: ComplexFloat — "U.Nakamura" <usa@...> 2008/04/10

こんにちは、なかむら(う)です。

[#34293] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34296] Re: ComplexFloat — "U.Nakamura" <usa@...> 2008/04/10

こんにちは、なかむら(う)です。

[#34298] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34300] Re: ComplexFloat — Tanaka Akira <akr@...> 2008/04/10

In article <761216ce0804100221x67f10f12iab12b0e35b6f50e4@mail.gmail.com>,

[#34301] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34303] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/10

まつもと ゆきひろです

[#34314] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/10

利点としては、拡張ライブラリが書きやすい、ということ。正当化の理由とし

[#34316] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34317] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/10

> 私にはいびつな進化という感じはしません.むしろ,せっかく C で実装できるのに

[#34318] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/10

むらたです.

[#34322] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/10

まつもと ゆきひろです

[#34328] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/11

むらたです.

[#34331] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/11

まつもと ゆきひろです

[#34340] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/11

むらたです.

[#34341] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/11

まつもと ゆきひろです

[#34362] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34363] Re: ComplexFloat — Tanaka Akira <akr@...> 2008/04/12

In article <761216ce0804120723n16bfbad7qdae90f142978d256@mail.gmail.com>,

[#34367] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34368] Re: ComplexFloat — Tanaka Akira <akr@...> 2008/04/12

In article <761216ce0804121011h6132d58fh4916ecbb29d58690@mail.gmail.com>,

[#34369] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34364] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/12

まつもと ゆきひろです

[#34366] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/12

むらたです.

[#34386] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/13

まつもと ゆきひろです

[#34415] Re: ComplexFloat — "Kenta Murata" <muraken@...> 2008/04/15

むらたです.

[#34439] Re: ComplexFloat — Shin-ichiro HARA <sinara@...> 2008/04/17

原です。

[#34442] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/04/17

まつもと ゆきひろです

[#34451] Re: ComplexFloat — Shin-ichiro HARA <sinara@...> 2008/04/18

原です。

[#34455] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/18

> 1. ComplexFloat を組込みにし、Complex を標準ライブラリとして提供する。

[#34457] Re: ComplexFloat — Shin-ichiro HARA <sinara@...> 2008/04/20

原です。

[#34458] Re: ComplexFloat — Tadayoshi Funaba <tadf@...> 2008/04/20

> 分かりににくかったですが、これは、ComplexFloat を含めた組込みの数体系が

[#34502] Re: ComplexFloat — sheepman <sh@...> 2008/04/24

こんばんは sheepman です。

[#34601] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/05/07

まつもと ゆきひろです

[#34603] Re: ComplexFloat — keiju@... (石塚圭樹) 2008/05/07

けいじゅ@いしつかです.

[#34614] Re: ComplexFloat — Yukihiro Matsumoto <matz@...> 2008/05/08

まつもと ゆきひろです

[#34621] Re: ComplexFloat — keiju@... (石塚圭樹) 2008/05/08

けいじゅ@いしつかです.

[ruby-dev:34348] packing GC globals

From: Nobuyoshi Nakada <nobu@...>
Date: 2008-04-12 04:09:01 UTC
List: ruby-dev #34348
なかだです。

gc.cのグローバル変数を構造体にまとめようと思いますが、名前とか構
造とか、御意見募集。


Index: gc.c
===================================================================
--- gc.c	(revision 15984)
+++ gc.c	(working copy)
@@ -85,17 +85,7 @@ void *alloca ();
 #endif
 
-static unsigned long malloc_increase = 0;
-static unsigned long malloc_limit = GC_MALLOC_LIMIT;
 static VALUE nomem_error;
 
-static int dont_gc;
-static int during_gc;
-static int need_call_final = 0;
-static st_table *finalizer_table = 0;
-
 #define MARK_STACK_MAX 1024
-static VALUE mark_stack[MARK_STACK_MAX];
-static VALUE *mark_stack_ptr;
-static int mark_stack_overflow;
 
 int ruby_gc_debug_indent = 0;
@@ -140,22 +130,81 @@ typedef struct RVALUE {
 #endif
 
-static RVALUE *freelist = 0;
-static RVALUE *deferred_final_list = 0;
-
 #define HEAPS_INCREMENT 10
-static struct heaps_slot {
+struct heaps_slot {
     void *membase;
     RVALUE *slot;
     int limit;
-} *heaps;
-static int heaps_length = 0;
-static int heaps_used   = 0;
+};
 
 #define HEAP_MIN_SLOTS 10000
-static int heap_slots = HEAP_MIN_SLOTS;
-
 #define FREE_MIN  4096
 
-static RVALUE *himem, *lomem;
+struct gc_list {
+    VALUE *varptr;
+    struct gc_list *next;
+};
+
+typedef struct {
+    struct {
+	unsigned long limit;
+	unsigned long increase;
+    } params;
+    struct {
+	int slots;
+	struct heaps_slot *ptr;
+	int length;
+	int used;
+	RVALUE *freelist;
+	RVALUE *range[2];
+    } heap;
+    struct {
+	int dont_gc;
+	int during_gc;
+    } flags;
+    struct {
+	int need_call;
+	st_table *table;
+	RVALUE *deferred;
+    } final;
+    struct {
+	VALUE buffer[MARK_STACK_MAX];
+	VALUE *ptr;
+	int overflow;
+    } markstack;
+    struct gc_list *global_list;
+} rb_objspace_t;
+
+static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
+/* #define objspace GET_VM()->objspace */
+#define malloc_limit		objspace->params.limit
+#define malloc_increase 	objspace->params.increase
+#define heap_slots		objspace->heap.slots
+#define heaps			objspace->heap.ptr
+#define heaps_length		objspace->heap.length
+#define heaps_used		objspace->heap.used
+#define freelist		objspace->heap.freelist
+#define lomem			objspace->heap.range[0]
+#define himem			objspace->heap.range[1]
+#define dont_gc 		objspace->flags.dont_gc
+#define during_gc		objspace->flags.during_gc
+#define need_call_final 	objspace->final.need_call
+#define finalizer_table 	objspace->final.table
+#define deferred_final_list	objspace->final.deferred
+#define mark_stack		objspace->markstack.buffer
+#define mark_stack_ptr		objspace->markstack.ptr
+#define mark_stack_overflow	objspace->markstack.overflow
+#define global_List		objspace->global_list
+
+rb_objspace_t *
+rb_objspace_alloc(void)
+{
+    rb_objspace_t *objspace = ALLOC(rb_objspace_t);
+    memset(objspace, 0, sizeof(*objspace));
+    malloc_limit = GC_MALLOC_LIMIT;
+    heap_slots = HEAP_MIN_SLOTS;
+    return objspace;
+}
+
+#define objspace (&rb_objspace)
 
 extern st_table *rb_class_tbl;
@@ -372,9 +421,4 @@ rb_gc_disable(void)
 VALUE rb_mGC;
 
-static struct gc_list {
-    VALUE *varptr;
-    struct gc_list *next;
-} *global_List = 0;
-
 void
 rb_gc_register_address(VALUE *addr)


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next