Re: [Vala] Custom array free functions



On Tue, 2011-04-26 at 11:55 +0200, Luca Bruno wrote:
On Tue, Apr 26, 2011 at 11:49:56AM +0200, Maciej Marcin Piechotka wrote:
IMHO it doesn't matter that code does not crash. Consider such code in
90's:

If you want to shoot yourself by ignoring that XFree() is equivalent to
free() 

As I pointed out there were pogrammers who 'avoided shooting themselves'
by thinking that the pointer have 32 bits. Or int have 32 bits. Or
sizeof (void *) == sizeof (int). Or used pointer after freeing it as it
worked and didn't crash in some version of Windows[1].

The problem is that using free works by accident and it may change in
future for some reasons.

Regards 

[1] IIRC one game used it. However it started crashing after move to NT
architecture so there was made an exception for this particular game to
avoid 'Microsoft keeps breaking things' cry.
The problem is that being backward-compatible with incorrect API use may
unnecessary restrict the development. 

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]