From: Mathieu Bouchard Date: 2005-07-15T03:04:59+09:00 Subject: Re: GC tweak On Thu, 14 Jul 2005, Stefan Kaes wrote: > Any comments? isn't the following a bit more straightforward? static void set_gc_param(int *var, const char *name) { char *p = getenv(name); if (p) { int i = atoi(p); if (i>0) *var = i; } } static void set_gc_parameters(void) { set_gc_param(heap_min_slots, "RUBY_HEAP_MIN_SLOTS"); set_gc_param(heap_free_min, "RUBY_HEAP_FREE_MIN"); set_gc_param(heaps_increment,"RUBY_HEAP_INCREMENT"); set_gc_param(gc_stats, "RUBY_GC_STATS"); set_gc_param(malloc_limit, "RUBY_GC_MALLOC_LIMIT"); heap_slots = heap_min_slots; } ,-o--------o--------o--------o-. ,---. irc.freenode.net #dataflow | | The Diagram is the Program tm| | ,-o-------------o--------------o-. `-o------------o-------------o-' | | Mathieu Bouchard (Montr�al QC) | | t�l�phone:+1.514.383.3801`---' `-o-- http://artengine.ca/matju -'