sbrk inertia

utzoo!decvax!harpo!eagle!mhuxt!mhuxa!mhb5b!mjs utzoo!decvax!harpo!eagle!mhuxt!mhuxa!mhb5b!mjs
Thu Mar 24 12:00:42 AEST 1983


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 at mhb5b.uucp
UUCP:		{allegra,rabbit,alice,mhb5b,mhb5c}!mjs
USPS:		600 Mountain Avenue Room 5F-120
		Murray Hill, NJ 07974



More information about the Net.bugs mailing list