raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / Atom feed
* [PATCH] TCP_Info: custom documentation for #get!
@ 2017-03-01  2:55 Eric Wong
  0 siblings, 0 replies; 1+ messages in thread
From: Eric Wong @ 2017-03-01  2:55 UTC (permalink / raw)
  To: raindrops-public

While #get! is the same as the #initialize method,
the former is public and called explicitly by folks
wishing to reduce allocation overhead.
---
 ext/raindrops/linux_tcp_info.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ext/raindrops/linux_tcp_info.c b/ext/raindrops/linux_tcp_info.c
index eebca94..4693e47 100644
--- a/ext/raindrops/linux_tcp_info.c
+++ b/ext/raindrops/linux_tcp_info.c
@@ -131,6 +131,19 @@ void Init_raindrops_linux_tcp_info(void)
 	cTCP_Info = rb_define_class_under(cRaindrops, "TCP_Info", rb_cObject);
 	rb_define_alloc_func(cTCP_Info, alloc);
 	rb_define_private_method(cTCP_Info, "initialize", init, 1);
+
+	/*
+	 * Document-method: Raindrops::TCP_Info#get!
+	 *
+	 * call-seq:
+	 *
+	 *	info = Raindrops::TCP_Info.new(tcp_socket)
+	 *	info.get!(tcp_socket)
+	 *
+	 * Update an existing TCP_Info objects with the latest stats
+	 * from the given socket.  This even allows sharing TCP_Info
+	 * objects between different sockets to avoid garbage.
+	 */
 	rb_define_method(cTCP_Info, "get!", init, 1);
 
 #define TCPI_DEFINE_METHOD(x) \
-- 
EW


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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01  2:55 [PATCH] TCP_Info: custom documentation for #get! Eric Wong

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

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

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

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

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