malloc types into a structure, a pointer to which is passed around, instead of an int constant. Allow the limit to be adjusted when the malloc type is defined, or with a function call, as suggested by Jonathan Stone.
boris popov, first ported to 1.4 branch by Christian Limpach <chris@nice.ch>.