This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: [ECOS] Mixed use of delete with malloc in fclose
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Guenter Ebermann <guenter dot ebermann at gmx dot at>
- Cc: eCos Patches List <ecos-patches at ecos dot sourceware dot org>
- Date: Mon, 21 Jul 2008 11:39:50 +0100
- Subject: Re: [ECOS] Mixed use of delete with malloc in fclose
- Openpgp: id=A5FB74E6
- References: <20080627085844.163860@gmx.net> <487B388D.4010507@eCosCentric.com> <20080720001942.146310@gmx.net>
Guenter Ebermann wrote:
> Jonathan Larmour wrote:
>> So just so I'm sure I understand it, this patch is not fixing
>> a problem, it's just a bit of cleanup, right?
>
> Its a sort of rule when implementing C++: If new is used delete must be
> used. Otherwise if malloc is used free must be used. Mixing these functions
> is not allowed.
I suppose, although in practice we know how GCC works :).
Anyway, patch applied, thanks.
Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------ Opinions==mine