clogger RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: clogger@librelist.org
Subject: [PATCH 1/6] blocking_helpers: remove fstat wrapper
Date: Sat, 15 Feb 2014 23:09:03 +0000
Message-ID: <1392505748-13740-1-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: <1392505748-13740-1-git-send-email-normalperson@yhbt.net>

The fstat syscall should never take long, even on sockets and
slow FSes.
---
 ext/clogger_ext/blocking_helpers.h | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/ext/clogger_ext/blocking_helpers.h b/ext/clogger_ext/blocking_helpers.h
index dd46cea..bb366ff 100644
--- a/ext/clogger_ext/blocking_helpers.h
+++ b/ext/clogger_ext/blocking_helpers.h
@@ -18,22 +18,6 @@ static int my_stat(const char *path, struct stat *buf)
            rb_thread_blocking_region((fn),(data), RUBY_UBF_IO, 0)
 #endif
 
-struct fstat_args { int fd; struct stat *buf; };
-static VALUE ng_fstat(void *ptr)
-{
-	struct fstat_args *a = ptr;
-	return (VALUE)fstat(a->fd, a->buf);
-}
-
-static int my_fstat(int fd, struct stat *buf)
-{
-	struct fstat_args a;
-
-	a.fd = fd;
-	a.buf = buf;
-	return (int)rb_thread_io_blocking_region(ng_fstat, &a, fd);
-}
-
 struct write_args { int fd; const void *buf; size_t count; };
 static VALUE ng_write(void *ptr)
 {
@@ -53,6 +37,5 @@ static ssize_t my_write(int fd, const void *buf, size_t count)
 	return r;
 }
 #  define stat(fd,buf) my_stat((fd),(buf))
-#  define fstat(fd,buf) my_fstat((fd),(buf))
 #  define write(fd,buf,count) my_write((fd),(buf),(count))
 #endif
-- 
1.9.0.rc3.13.gda73b5f



       reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-15 23:09 Eric Wong [this message]
2014-02-15 23:09 ` [PATCH 2/6] remove unused RARRAY_PTR macro Eric Wong
2014-02-15 23:09 ` [PATCH 3/6] use RB_GC_GUARD instead of volatile Eric Wong
2014-02-15 23:09 ` [PATCH 4/6] prevent potential premature GC in byte_xs Eric Wong
2014-02-15 23:09 ` [PATCH 5/6] remove each_id, it was never used Eric Wong
2014-02-15 23:09 ` [PATCH 6/6] use rb_thread_call_without_gvl for Ruby 2+ Eric Wong

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/clogger/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392505748-13740-1-git-send-email-normalperson@yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=clogger@librelist.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

clogger RubyGem user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://bogomips.org/clogger-public
	git clone --mirror http://ou63pmih66umazou.onion/clogger-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.clogger
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.clogger

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox