[ODE] alloc versus malloc

Alon Levy alonl at techunix.technion.ac.il
Wed Feb 13 10:15:02 2002


Hello Everyone,

	My simulation got too big and crashed. I traced the problem to the dSetZero and ALLOCA in lcp.cpp. My first fix was to
change ALLOCA (which is a #define) from alloc to malloc (its actually a macro that calls alloc with a 16 byte rounded size), and
added the much needed free calls at the end of each function in lcp.cpp. I think it was only really needed where i got the seg fault,
which is in dSolveLCP.
	After that the memory limit was lifted significantly. I tested using the dTestSolveLCP modified slightly so I give it n as
a parameter (it was set to 100 originally). with ALLOCA=~alloc I got shot down at n~500. with ALLOCA=malloc + free I can get
to 1000. then dSetZero becomes the problem (I don't know why yet).

Anyone with similar experiences? If not, does anyone know what could make alloc act wierdly on my system and mine alone? I'm
running linux 2.4.18pre6, and gcc 2.95.4.

Alon