ruby-changes:28282
From: tmm1 <ko1@a...>
Date: Wed, 17 Apr 2013 19:55:38 +0900 (JST)
Subject: [ruby-changes:28282] tmm1:r40334 (trunk): iseq.c: remove duplicated strings for file paths
tmm1 2013-04-17 19:55:29 +0900 (Wed, 17 Apr 2013) New Revision: 40334 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40334 Log: iseq.c: remove duplicated strings for file paths * iseq.c (iseq_location_setup): re-use existing string when iseq has the same path and absolute_path. [Bug #8149] Modified files: trunk/ChangeLog trunk/iseq.c Index: ChangeLog =================================================================== --- ChangeLog (revision 40333) +++ ChangeLog (revision 40334) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Apr 17 19:45:27 2013 Aman Gupta <tmm1@r...> + + * iseq.c (iseq_location_setup): re-use existing string when iseq has + the same path and absolute_path. [Bug #8149] + Wed Apr 17 11:38:37 2013 Nobuyoshi Nakada <nobu@r...> * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert): Index: iseq.c =================================================================== --- iseq.c (revision 40333) +++ iseq.c (revision 40334) @@ -188,7 +188,10 @@ iseq_location_setup(rb_iseq_t *iseq, VAL https://github.com/ruby/ruby/blob/trunk/iseq.c#L188 { rb_iseq_location_t *loc = &iseq->location; loc->path = path; - loc->absolute_path = absolute_path; + if (RTEST(absolute_path) && rb_str_cmp(path, absolute_path) == 0) + loc->absolute_path = path; + else + loc->absolute_path = absolute_path; loc->label = loc->base_label = name; loc->first_lineno = first_lineno; return loc; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/