adds a few setmalloctag to debug programs using images and fonts. defines a few keys in keyboard.h, like Esc, Del, etc.. Nothing serious :-) Reference: /n/sources/patch/applied/drawmalloctagsandkeys Date: Wed Nov 9 18:42:03 CET 2005 --- /sys/src/libdraw/alloc.c Wed Nov 9 18:40:03 2005 +++ /sys/src/libdraw/alloc.c Wed Nov 9 18:40:00 2005 @@ -5,7 +5,12 @@ Image* allocimage(Display *d, Rectangle r, ulong chan, int repl, ulong val) { - return _allocimage(nil, d, r, chan, repl, val, 0, 0); + Image* i; + + i = _allocimage(nil, d, r, chan, repl, val, 0, 0); + if (i) + setmalloctag(i, getcallerpc(&d)); + return i; } Image* --- /sys/src/libdraw/creadimage.c Wed Nov 9 18:40:15 2005 +++ /sys/src/libdraw/creadimage.c Wed Nov 9 18:40:12 2005 @@ -58,6 +58,7 @@ if(dolock) lockdisplay(d); i = allocimage(d, r, chan, 0, 0); + setmalloctag(i, getcallerpc(&d)); if(dolock) unlockdisplay(d); if(i == nil) --- /sys/src/libdraw/getsubfont.c Wed Nov 9 18:40:31 2005 +++ /sys/src/libdraw/getsubfont.c Wed Nov 9 18:40:28 2005 @@ -32,5 +32,6 @@ if(f == 0) fprint(2, "getsubfont: can't read %s: %r\n", name); close(fd); + setmalloctag(f, getcallerpc(&d)); return f; } --- /sys/include/keyboard.h Wed Nov 9 18:40:48 2005 +++ /sys/include/keyboard.h Wed Nov 9 18:40:46 2005 @@ -38,4 +38,9 @@ Kalt= KF|0x15, Kshift= KF|0x16, Kctl= KF|0x17, + + Kbs = 0x08, + Kdel= 0x7f, + Kesc= 0x1b, + Keof= 0x04, };