clogger RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [PATCH 1/6] blocking_helpers: remove fstat wrapper
@ 2014-02-15 23:09 Eric Wong
  2014-02-15 23:09 ` [PATCH 2/6] remove unused RARRAY_PTR macro Eric Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Eric Wong @ 2014-02-15 23:09 UTC (permalink / raw)
  To: clogger

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-15 23:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 23:09 [PATCH 1/6] blocking_helpers: remove fstat wrapper Eric Wong
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

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

	https://yhbt.net/clogger.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).