Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!houxm!ho95e!wcs From: wcs@ho95e.UUCP (#Bill_Stewart) Newsgroups: net.unix-wizards,net.sources.bugs Subject: Re: What happens during an unlink(2) - really malloc() Message-ID: <662@ho95e.UUCP> Date: Wed, 30-Apr-86 16:51:49 EDT Article-I.D.: ho95e.662 Posted: Wed Apr 30 16:51:49 1986 Date-Received: Fri, 2-May-86 23:55:49 EDT References: <947@kitty.UUCP> <403@ukecc.UUCP> <979@kitty.UUCP> <422@ukecc.UUCP> Reply-To: wcs@ho95e.UUCP (Bill Stewart 1-201-949-0705 ihnp4!ho95c!wcs HO 2G202) Organization: AT&T Bell Labs, Holmdel NJ Lines: 23 Keywords: ``Relink'' April Fool Xref: watmath net.unix-wizards:17877 net.sources.bugs:815 Summary: Please write portable code! In article <422@ukecc.UUCP> edward@ukecc.UUCP (Edward C. Bennett) writes: > >>.....[stuff about what happens to blocks when you unlink the file]... > When the old data blocks are placed in the free list, their contents >are unimportant. Zeroing the blocks would be a waste of time since whatever >is there will be overwritten when the blocks are allocated to another file. >This situation is identical to the malloc()/free() process. i.e. Space >that has been malloc()ed will have data written into it. When this space >is free()ed, the data in it is not altered and is useable until the next >malloc(). Please don't depend on this behaviour! Under the older mallocs (including System V and 4.1BSD), you could depend on it, but systems with newer and fancier mallocs don't promise it. In particular, System V Release 2 offers two malloc routines. The default is the old malloc, but the new -lmalloc library provides routines that offer better performance under some kinds of input, and the man page says you can't trust freed-up memory after a free() or realloc(). In general, the safety of using freed space depends on the implementation of the data structures chaining space together. -- # Bill Stewart, AT&T Bell Labs 2G-202, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs