On my system with ~250 processes running, this loop has to run over 500 times before allocating enough memory. Use better initial and increment values to avoid thrashing the heap.
Having them declared statically in a header included by multiple compilation units results in duplicate functions being created.