This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gsl comments


Gerard Jungman writes:
 > I think we could have done it the right way, but we seem stuck
 > with what we have now. Brian: any comments?

As you say, it's all because we follow c conventions.  Combining Alloc
and initialisation is safer/more user-friendly but not the "c way".

The one place where you might want to separate allocation and
initialisation is in long-running embedded systems where all memory is
allocated once at startup so that it is guaranteed not to leak.  If
you follow this model it is more natural to separate them.

The free(0) thing is a bit of a non-issue in my opinion, free(0) is
valid ANSI/ISO C (from 1989).  Better to install a replacement malloc
(e.g. gnumalloc) on any system that has a problem with it and fix it
in the right place.

-- 
Brian Gough


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]