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


On Thu, 2005-03-24 at 19:09 +0000, Brian Gough wrote:
> 
> 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.

Yes, but the safe and reasonable design is

    alloc_and_initialize()
    reinitialize()

as opposed to

    alloc()
    initialize()




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