Robert Watson <rwatson@FreeBSD.org> writes:I don't do that any more. Unless the program I'm writing is intended to run for a long time and can gracefully handle an out-of-memory situation (such as denying client requests until the situation improves), I write malloc() wrappers which zero the allocated region before returning to the caller, to force a SIGSEGV and spare the caller from having to check the return value. I sometimes also allocate a little bit extra and stick a magic signature and an allocation length in there so my free() wrapper can check for bugs and zero the allocated memory before freeing it. I wouldn't need any of this if my code only ran on FreeBSD, but most of my $DAYTIME_JOB code these days runs on Linux first and FreeBSD second. DES -- Dag-Erling Smørgrav - des@des.no _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Christoph Lameter | Re: Major regression on hackbench with SLUB (more numbers) |
| Mike Travis | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
git: | |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Hugh Dickins | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
