[#688] mkmf.rb - add files to clean and distclean targets — Michal Rokos <michal@...>

Hi,

25 messages 2003/01/15
[#722] Re: [RFC] mkmf.rb - add files to clean and distclean targets — Mathieu Bouchard <matju@...> 2003/01/20

On Thu, 16 Jan 2003, Michal Rokos wrote:

[#740] Re: [RFC] mkmf.rb - add files to clean and distclean targets — matz@... (Yukihiro Matsumoto) 2003/01/21

Hi,

[#724] Symbols: More Functionality Wanted — Ryan Pavlik <rpav@...>

I've been discussing this for a bit on #ruby-lang on OPN (or freenode or

23 messages 2003/01/20
[#728] Re: Symbols: More Functionality Wanted — matz@... (Yukihiro Matsumoto) 2003/01/20

Hi,

[#743] Re: Symbols: More Functionality Wanted — "Pit Capitain" <pit@...> 2003/01/21

On 20 Jan 2003 at 15:49, Yukihiro Matsumoto wrote:

[#767] Re: Symbols: More Functionality Wanted — Mathieu Bouchard <matju@...> 2003/01/22

[#768] Re: Symbols: More Functionality Wanted — dblack@... 2003/01/22

Hi --

[#779] Re: Symbols: More Functionality Wanted — Gavin Sinclair <gsinclair@...> 2003/01/23

On Thursday, January 23, 2003, 6:28:04 AM, dblack wrote:

[Patches] Mem leak & found on disk

From: Michal Rokos <michal@...>
Date: 2003-01-28 18:36:04 UTC
List: ruby-core #792
Hi,

is there a small leak in dir.c?
Index: dir.c
===================================================================
RCS file: /src/ruby/dir.c,v
retrieving revision 1.82
diff -u -p -r1.82 dir.c
--- dir.c	16 Jan 2003 07:34:01 -0000	1.82
+++ dir.c	28 Jan 2003 18:24:39 -0000
@@ -778,6 +778,7 @@ glob_helper(path, sub, flags, func, arg)
  		    sprintf(buf, "%s%s%s", base, (BASE) ? "/" : "", dp->d_name);
  		    if (lstat(buf, &st) < 0) {
  			if (errno != ENOENT) rb_sys_warning(buf);
+			free(buf);
  			continue;
  		    }
  		    if (S_ISDIR(st.st_mode)) {


This I've found on disk: Is there any reason to allocate ary with 2000?
Index: enum.c
===================================================================
RCS file: /src/ruby/enum.c,v
retrieving revision 1.29
diff -u -p -r1.29 enum.c
--- enum.c	2002/08/01 09:42:36	1.29
+++ enum.c	2002/10/01 10:35:22
@@ -274,7 +274,12 @@ enum_sort_by(obj)
      VALUE ary;
      long i;

-    ary  = rb_ary_new2((TYPE(obj) == T_ARRAY) ? RARRAY(obj)->len : 2000);
+    if (TYPE(obj) == T_ARRAY) {
+	ary  = rb_ary_new2(RARRAY(obj)->len);
+    }
+    else {
+	ary = rb_ary_new();
+    }
      rb_iterate(rb_each, obj, sort_by_i, ary);
      if (RARRAY(ary)->len > 1) {
  	qsort(RARRAY(ary)->ptr, RARRAY(ary)->len, sizeof(VALUE), sort_by_cmp);

Michal


In This Thread

Prev Next