File:  [Research Unix] / researchv10dc / vol2 / anim / malloc.awk
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

awk '
BEGIN	      {	OFS = "\t"; w = 1024 }
$1 == "m"     { s = $2
		ehist[s] = e = s + $3
		sx = s % w; sy = int(s / w)
		ex = e % w; ey = int(e / w)
		if (sy == ey) print "a" s ": line", sx, sy, ex, sy
		else {	print "a" s ": line " sx " " sy " " w " " sy
			for (i = sy+1; i <= ey-1; i++)
				print "b" i ": line", 0, i, w, i
			print "c" ey ": line", 0, ey, ex, ey
		}
	      }
$1 == "f"     {	s = $2
		e = ehist[s]
		sx = s % w; sy = int(s / w)
		ex = e % w; ey = int(e / w)
		if (sy == ey) print "erase a" s
		else {	print "erase a" s
			for (i = sy+1; i <= ey-1; i++)
				print "erase b" i
			print "erase c" ey
		}
	      }
	      {	print "click call" }
' $*

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.