From df3d3a0b09f05249aff9f25f558f988bfcad8874 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 22 Feb 2011 19:24:55 -0800 Subject: add Raindrops::MAX constant This is the highest number a counter may be incremented to before it overflows. --- ext/raindrops/raindrops.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/raindrops/raindrops.c') diff --git a/ext/raindrops/raindrops.c b/ext/raindrops/raindrops.c index 599f39d..766ee02 100644 --- a/ext/raindrops/raindrops.c +++ b/ext/raindrops/raindrops.c @@ -203,6 +203,9 @@ void Init_raindrops_ext(void) #endif rb_define_const(cRaindrops, "SIZE", SIZET2NUM(raindrop_size)); + /* the maximum value a raindrop counter can hold */ + rb_define_const(cRaindrops, "MAX", ULONG2NUM((unsigned long)-1)); + rb_define_alloc_func(cRaindrops, alloc); rb_define_method(cRaindrops, "initialize", init, 1); -- cgit v1.2.3-24-ge0c7