From: David M. <da...@as...> - 2010-01-13 09:10:20
|
Humbly offered for your consideration... After the attached patch (plus the other attached "uncrustify" patch), plAlloc2dGrid will allocate one block of memory that is big enough for nx pointers plus nx*ny PLFLTs. This means only one call to malloc and only one call to free no matter how big nx is. It also avoids the "bug" in plAlloc2dGrid that neglects to free memory already allocated if fewer than nx of the ny-element arrays can be allocated. I have tested this patch using x08c and x011c (both of which use these functions considerably). The examples work and no leaks were introduced (according to the "leaks" command). Dave |