[#3234] sample of TkFont class — NAGAI Hidetoshi <nagai@...>

永井@知能.九工大です.

52 messages 1998/07/08
[#3241] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/09

永井@知能.九工大です.

[#3290] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/15

永井@知能.九工大です.

[#3291] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/15

まつもと ゆきひろです

[#3307] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

永井@知能.九工大です.

[#3309] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/16

まつもと ゆきひろです

[#3319] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

永井@知能.九工大です.

[#3321] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/16

まつもと ゆきひろです

[#3324] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

永井@知能.九工大です.

[#3367] Re: sample of TkFont class — Tadayoshi Funaba <tadf@...> 1998/07/22

ふなばです。

[#3369] Re: sample of TkFont class — ttate@... 1998/07/22

立石@JAISTです。

[#3370] Re: sample of TkFont class — Tadayoshi Funaba <tadf@...> 1998/07/22

ふなばです。

[#3371] Re: sample of TkFont class — ttate@... 1998/07/23

立石@JAISTです。

[#3292] exprimental release 1.1b9_31 (hopefully final) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

20 messages 1998/07/15
[#3293] Re: exprimental release 1.1b9_31 (hopefully final) — Takahiro Maebashi <maebashi@...> 1998/07/15

前橋です。

[#3294] Re: exprimental release 1.1b9_31 (hopefully final) — matz@... (Yukihiro Matsumoto) 1998/07/15

まつもと ゆきひろです

[#3295] Re: exprimental release 1.1b9_31 (hopefully final) — Takahiro Maebashi <maebashi@...> 1998/07/15

前橋です。

[ruby-dev:3283] [Request] GC methods

From: ttate@...
Date: 1998-07-13 18:56:15 UTC
List: ruby-dev #3283
立石@JAISTです。

GCへ以下のようなメソッドの追加は
どうでしょうか?


*** gc.c.orig	Tue Jul 14 02:22:19 1998
--- gc.c	Tue Jul 14 03:39:44 1998
***************
*** 44,49 ****
--- 44,51 ----
  #endif
  
  static unsigned long malloc_memories = 0;
+ static unsigned long rb_gc_malloc_limit = GC_MALLOC_LIMIT;
+ static int rb_gc_show_flag = 0;
  
  void *
  xmalloc(size)
***************
*** 55,66 ****
  	ArgError("negative allocation size (or too big)");
      }
      if (size == 0) size = 1;
! #if 0
!     malloc_memories += size;
!     if (malloc_memories > GC_MALLOC_LIMIT) {
  	gc_gc();
!     }
! #endif
      mem = malloc(size);
      if (!mem) {
  	gc_gc();
--- 57,70 ----
  	ArgError("negative allocation size (or too big)");
      }
      if (size == 0) size = 1;
! 
!     if( rb_gc_malloc_limit > 0 ){
!       malloc_memories += size;
!       if (malloc_memories > rb_gc_malloc_limit) {
  	gc_gc();
!       }
!     };
! 
      mem = malloc(size);
      if (!mem) {
  	gc_gc();
***************
*** 157,162 ****
--- 161,199 ----
      return old;
  }
  
+ VALUE
+ gc_s_limit(VALUE self)
+ {
+   return uint2inum(rb_gc_malloc_limit);
+ }
+ 
+ VALUE
+ gc_s_set_limit(VALUE self, VALUE num)
+ {
+   rb_gc_malloc_limit = num2ulong(num);
+   return Qnil;
+ }
+ 
+ VALUE
+ gc_s_show_q(VALUE self)
+ {
+   return( rb_gc_show_flag ? TRUE : FALSE );
+ }
+ 
+ VALUE
+ gc_s_show(VALUE self)
+ {
+   rb_gc_show_flag = 1;
+   return Qnil;
+ }
+ 
+ VALUE
+ gc_s_unshow(VALUE self)
+ {
+   rb_gc_show_flag = 0;
+   return Qnil;
+ }
+ 
  VALUE mGC;
  
  static struct gc_list {
***************
*** 803,808 ****
--- 840,848 ----
      if (dont_gc) return;
      dont_gc++;
  
+     if( rb_gc_show_flag )
+       fprintf(stderr,"Garbage Collect Start.\n");
+ 
      malloc_memories = 0;
  #ifdef C_ALLOCA
      alloca(0);
***************
*** 844,849 ****
--- 884,892 ----
  
      gc_sweep();
      dont_gc--;
+ 
+     if( rb_gc_show_flag )
+       fprintf(stderr,"Done.\n");
  }
  
  static VALUE
***************
*** 1060,1065 ****
--- 1103,1114 ----
      rb_define_singleton_method(mGC, "start", gc_method, 0);
      rb_define_singleton_method(mGC, "enable", gc_s_enable, 0);
      rb_define_singleton_method(mGC, "disable", gc_s_disable, 0);
+     rb_define_singleton_method(mGC, "limit", gc_s_limit, 0);
+     rb_define_singleton_method(mGC, "set_limit", gc_s_set_limit, 1);
+     rb_define_singleton_method(mGC, "limit=", gc_s_set_limit, 1);
+     rb_define_singleton_method(mGC, "show?", gc_s_show_q, 0);
+     rb_define_singleton_method(mGC, "show", gc_s_show, 0);
+     rb_define_singleton_method(mGC, "unshow", gc_s_unshow, 0);
      rb_define_method(mGC, "garbage_collect", gc_method, 0);
  
      mObSpace = rb_define_module("ObjectSpace");

In This Thread

Prev Next