raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] raindrops 0.12.0 - compatibility fixes
@ 2013-09-02 10:54  5% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2013-09-02 10:54 UTC (permalink / raw)
  To: raindrops

Changes:

This release fixes builds on systems where compilers target i386
(and not later x86 systems).  There are also minor improvements for
Ruby 2.1.0dev and Rubinius.

Eric Wong (5):
      doc: add email address to generated doc/site
      README: update regarding Ruby support status
      extconf: try harder for gcc atomics in i386-configured systems
      linux_inet_diag: improve compatibility with newer GCs
      test_watcher: fix for Ruby trunk r40195 and later

* http://raindrops.bogomips.org/
* raindrops@librelist.org
* git://bogomips.org/raindrops.git
* http://raindrops.bogomips.org/NEWS.atom.xml


^ permalink raw reply	[relevance 5%]

* Re: [PATCH] linux_inet_diag: improve compatibility with newer GCs
  2013-06-16 20:59  6% [PATCH] linux_inet_diag: improve compatibility with newer GCs Eric Wong
@ 2013-08-31  6:02  7% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2013-08-31  6:02 UTC (permalink / raw)
  To: raindrops

Eric Wong <normalperson@yhbt.net> wrote:
> RARRAY_PTR is expensive with GCs in Ruby 2.1.0dev and Rubinius, so
> use rb_ary_entry for non-performance critical paths.  Eventually,
> RARRAY_AREF/RARRAY_ASET may be common, but for now, using
> rb_ary_entry should require the least cognitive overhead for a
> developer.
> ---
>   Pushed to "gc-next" of git://bogomips.org/raindrops.git

Cherry-picked into master, will release 0.12.0 this weekend unless
there are objections.


^ permalink raw reply	[relevance 7%]

* [PATCH] linux_inet_diag: improve compatibility with newer GCs
@ 2013-06-16 20:59  6% Eric Wong
  2013-08-31  6:02  7% ` Eric Wong
  0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2013-06-16 20:59 UTC (permalink / raw)
  To: raindrops

RARRAY_PTR is expensive with GCs in Ruby 2.1.0dev and Rubinius, so
use rb_ary_entry for non-performance critical paths.  Eventually,
RARRAY_AREF/RARRAY_ASET may be common, but for now, using
rb_ary_entry should require the least cognitive overhead for a
developer.
---
  Pushed to "gc-next" of git://bogomips.org/raindrops.git

 ext/raindrops/linux_inet_diag.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c
index dcf7bc2..cd4a876 100644
--- a/ext/raindrops/linux_inet_diag.c
+++ b/ext/raindrops/linux_inet_diag.c
@@ -586,8 +586,6 @@ static VALUE tcp_stats(struct nogvl_args *args, VALUE addr)
  */
 static VALUE tcp_listener_stats(int argc, VALUE *argv, VALUE self)
 {
-	VALUE *ary;
-	long i;
 	VALUE rv = rb_hash_new();
 	struct nogvl_args args;
 	VALUE addrs, sock;
@@ -610,20 +608,26 @@ static VALUE tcp_listener_stats(int argc, VALUE *argv, VALUE self)
 	case T_STRING:
 		rb_hash_aset(rv, addrs, tcp_stats(&args, addrs));
 		return rv;
-	case T_ARRAY:
-		ary = RARRAY_PTR(addrs);
-		i = RARRAY_LEN(addrs);
-		if (i == 1) {
-			rb_hash_aset(rv, *ary, tcp_stats(&args, *ary));
+	case T_ARRAY: {
+		long i;
+		long len = RARRAY_LEN(addrs);
+		VALUE cur;
+
+		if (len == 1) {
+			cur = rb_ary_entry(addrs, 0);
+
+			rb_hash_aset(rv, cur, tcp_stats(&args, cur));
 			return rv;
 		}
-		for (; --i >= 0; ary++) {
+		for (i = 0; i < len; i++) {
 			union any_addr check;
+			VALUE cur = rb_ary_entry(addrs, i);
 
-			parse_addr(&check, *ary);
-			rb_hash_aset(rv, *ary, Qtrue);
+			parse_addr(&check, cur);
+			rb_hash_aset(rv, cur, Qtrue);
 		}
 		/* fall through */
+	}
 	case T_NIL:
 		args.table = st_init_strtable();
 		gen_bytecode_all(&args.iov[2]);
-- 
Eric Wong


^ permalink raw reply related	[relevance 6%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-06-16 20:59  6% [PATCH] linux_inet_diag: improve compatibility with newer GCs Eric Wong
2013-08-31  6:02  7% ` Eric Wong
2013-09-02 10:54  5% [ANN] raindrops 0.12.0 - compatibility fixes Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/raindrops.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).