Re: [patch, fortran] Always return malloc(1) for empty arrays in the library

2011-07-05 Thread Thomas Koenig
Hi Janne, Since size_t is unsigned, just test (size == 0). Otherwise Ok. Thanks for the patch. OK. Übertrage Daten ... Revision 175880 übertragen. Thanks for the review! Thomas

Re: [patch, fortran] Always return malloc(1) for empty arrays in the library

2011-07-03 Thread Janne Blomqvist
On Fri, Jul 1, 2011 at 21:31, Thomas Koenig wrote: > Is this better? Index: runtime/memory.c === --- runtime/memory.c(Revision 175598) +++ runtime/memory.c(Arbeitskopie) @@ -54,8 +54,8 @@ get_mem (size_t n) void * internal_

Re: [patch, fortran] Always return malloc(1) for empty arrays in the library

2011-07-01 Thread Thomas Koenig
Am 01.07.2011 14:34, schrieb Janne Blomqvist: On Thu, Jun 30, 2011 at 21:09, Thomas Koenig wrote: Good point. I have done so in the attached patch Seems you forgot to attach it.. ;) Oops, I hadn't realized your crystal ball was broken :-) Is this better? Thomas 2011-06-30 Thom

Re: [patch, fortran] Always return malloc(1) for empty arrays in the library

2011-07-01 Thread Janne Blomqvist
On Thu, Jun 30, 2011 at 21:09, Thomas Koenig wrote: > Good point.  I have done so in the attached patch Seems you forgot to attach it.. ;) -- Janne Blomqvist

Re: [patch, fortran] Always return malloc(1) for empty arrays in the library

2011-06-30 Thread Thomas Koenig
Hi Janne, I'd prefer to add the zero check to runtime/memory.c (internal_malloc_size), i.e. change if (size == 0) return NULL; to if (size == 0) size = 1; Good point. I have done so in the attached patch, plus removed all special cases for checking for zero size. Regression-tested.

Re: [patch, fortran] Always return malloc(1) for empty arrays in the library

2011-06-29 Thread Janne Blomqvist
On Wed, Jun 29, 2011 at 00:50, Thomas Koenig wrote: > Hello world, > > looking at PR 49479 and other functions in the library made me realize > there are lots of places where we don't malloc one byte for empty > arrays. I'd prefer to add the zero check to runtime/memory.c (internal_malloc_size),

[patch, fortran] Always return malloc(1) for empty arrays in the library

2011-06-28 Thread Thomas Koenig
Hello world, looking at PR 49479 and other functions in the library made me realize there are lots of places where we don't malloc one byte for empty arrays. This patch is an attempt at fixing the ton of regressions likely caused by this (like in the PR) which haven't been found yet. No test cas