From: utzoo!decvax!harpo!eagle!mhuxt!mhuxa!mhb5b!mjs Newsgroups: net.bugs Title: Re: sbrk inertia Article-I.D.: mhb5b.230 Posted: Thu Mar 24 12:00:42 1983 Received: Fri Mar 25 21:24:00 1983 References: <180@p500vax.UUCP> What you cite as a bug is simply the way it works. sbrk(n) returns either the address of a block of "n" bytes added to your address space, or it returns -1. In your example, you got the base of 0 bytes added to your space (no growth), then the base of 1 byte added to your space (growth of 1 byte; the result should always be the same number as the previous sbrk(0)!), then the address of the next 0 byte allocation (no growth). Graphically: --------------------- | | | | | | --------------------- ^ ^ 0 sbrk(0) ------------------------- | | | | | | | ------------------------- ^ ^ 0 sbrk(1) ------------------------- | | | | | | | ------------------------- ^ ^ 0 sbrk(0) Martin Shannon, Jr. Phone: (201) 582-3199 Internet: mjs@mhb5b.uucp UUCP: {allegra,rabbit,alice,mhb5b,mhb5c}!mjs USPS: 600 Mountain Avenue Room 5F-120 Murray Hill, NJ 07974