public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Brian Gough <bjg@network-theory.co.uk>
To: gsl-discuss@sources.redhat.com
Subject: Re: gsl comments
Date: Thu, 24 Mar 2005 19:10:00 -0000	[thread overview]
Message-ID: <16963.4227.743595.8004@network-theory.co.uk> (raw)
In-Reply-To: <1111605691.5234.422.camel@bellerophon.lanl.gov>

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

  reply	other threads:[~2005-03-24 19:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-23 17:01 Keith Weinman
2005-03-23 19:21 ` Gerard Jungman
2005-03-24 19:10   ` Brian Gough [this message]
2005-03-24 20:31     ` Gerard Jungman
2005-03-24 12:09 ` Brian Gough
     [not found]   ` <4242C0B6.7060203@dlr.de>
2005-03-24 19:02     ` Brian Gough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16963.4227.743595.8004@network-theory.co.uk \
    --to=bjg@network-theory.co.uk \
    --cc=gsl-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).