From 1850760188988633003
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1149ec,f5b50f79e3b33c8d
X-Google-Attributes: gid1149ec,public
X-Google-Thread: f78e5,c0143c56db298752
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-09-07 02:48:29 PST
Newsgroups: comp.std.c,comp.std.c++
Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!newsfeed.ACO.net!Austria.EU.net!rcvie!cett.alcatel-alsthom.fr!slsv6bt!news
From: kanze@us-es.sel.de (James Kanze US/ESC 60/3/164 #71425)
Subject: Re: malloc calls FROM the standard library (was: Re: Question on 5.2.3.)
In-Reply-To: rfg@netcom.com's message of Tue, 6 Sep 1994 09:47:27 GMT
Message-ID: <KANZE.94Sep6163759@slsvhdt.us-es.sel.de>
Lines: 31
Sender: news@lts.sel.alcatel.de
Organization: SEL
References: <MHP1.94Sep1112739@Ra.msstate.edu> <1994Sep2.102654.14783@ida.liu.se>
	<CvIH4L.8G2@crdnns.crd.ge.com> <rfgCvpCJ4.I3F@netcom.com>
Date: 06 Sep 1994 14:37:59 GMT
Xref: nntp.gmd.de comp.std.c:7746 comp.std.c++:8856

In article <rfgCvpCJ4.I3F@netcom.com> rfg@netcom.com (Ronald
F. Guilmette) writes:

|> It's my understanding that nothing provided by the implementation is
|> supposed to call malloc.  (At least that is the rule in ANSI/ISO C,
|> I believe.  I'm less sure about draft standard C++.)  In other words,
|> user's should be able to replace `malloc' which their own routine of
|> the same name.

What is the basis of your understanding?  I don't have my copy of the
ISO C standard here, so I am going out on a limb, but I believe that
in a hosted environment, all of the library function names are
reserved in the global name space.  (E.i.: you can write and use a
static function malloc if your compilation unit doesn't include
stdlib.h, but you are not allowed to provide a global one.)

As for malloc not being used by library routines, where does it say
this.  There are a number of definite statements of the sort: the
library shall perform as if function x is not called by any other
library routine, but I don't remember malloc being among them.

As for the upcoming C++ standard...  I believe that this is to be
handled by namespaces.  The system libraries are in a specific
namespace, and that namespace belongs to the system.  So you can
define as many mallocs as you like in other namespaces, but you cannot
define anything in the system namespace.
-- 
James Kanze                                  email: kanze@lts.sel.alcatel.de
GABI Software, Sarl., 8 rue des Francs Bourgeois, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                              -- Beratung in industrieller Datenverarbeitung


