From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam To: <9fans@cse.psu.edu> Subject: Re: [9fans] same functions everywhere In-Reply-To: <5258fb01cfa482d7b8d985e1c26dfac1@plan9.escet.urjc.es> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Thu, 24 Apr 2003 10:39:50 -0400 Topicbox-Message-UUID: 97f65110-eacb-11e9-9e20-41e7f4b1d025 > > Most of them do exactly the same, calling sysfatal. The only > different thing is the error string and sometimes, it is just "out of > memory" or variations on this. > Is the argument purely about ambiguity? I don't see anything about the name emalloc(...) that indicates it will take the program down. This is less of an issue in a program context as the scope is generally tighter (and the programmer wrote it). Perhaps if the name were changed to fatalmalloc and you could pass in a string for sysfatal it would be less ambiguous. It just seems like a moot point for 6 lines of code. If you want to pick on malloc, why not lambast mallocz for having the second parameter to qualify the zero'ing? Its primary use is for dynamically discerning whether to zero out the associated memory, and in grep '[^e]mallocz' `{du -a /sys/src | awk '{print $2}' | grep '\.c$'} | wc -l 149 149 uses there isn't one call that does this. Sam