Path: utzoo!attcan!uunet!clyde.concordia.ca!jarvis.csri.toronto.edu!rutgers!uwvax!umn-d-ub!umn-cs!mike From: mike@umn-cs.CS.UMN.EDU (Mike Haertel) Newsgroups: comp.unix.wizards Subject: Re: valloc(3) Message-ID: <17820@umn-cs.CS.UMN.EDU> Date: 15 Dec 89 19:12:23 GMT References: <1509@utkcs2.cs.utk.edu> Reply-To: mike@umn-cs.cs.umn.edu (Mike Haertel) Organization: Free Software Foundation Lines: 17 In article <1509@utkcs2.cs.utk.edu> battle@alphard.cs.utk.edu (David Battle) writes: >Is it safe to free memory allocated with valloc(3) using free(3) on >an Ultrix system? I ask because valloc adds some to the pointer >returned by malloc in order to allign the returned address. It may be safe on an Ultrix system. In general it is not safe. The "BUGS" section of the 4bsd manual page on valloc says "vfree() is not implemented." In 4.3BSD, valloc() is not compatible with free(). If you want your code to be portable, don't use valloc(). If you use valloc(), don't try to free what you get from it. -- Mike Haertel "Everything there is to know about playing the piano can be taught in half an hour, I'm convinced of it." -- Glenn Gould