shithub: mc

Download patch

ref: 9fc485a80b9713c1581a3c734d2d2bbf347f80e7
parent: 4ef66b11ded8bc99387219a81328d33c775ce7a9
parent: dd20049d283a34e86e328fdd132ab13526fcaa0b
author: Ori Bernstein <[email protected]>
date: Fri Jan 18 09:09:03 EST 2013

Merge branch 'master' of git+ssh://git.eigenstate.org/git/ori/mc

--- a/6/ra.c
+++ b/6/ra.c
@@ -12,15 +12,16 @@
 
 #define Sizetbits (CHAR_BIT*sizeof(size_t)) /* used in graph reprs */
 
-typedef struct Usage Usage;
-struct Usage {
-    int l[Maxarg + 1];
-    int r[Maxarg + 1];
+typedef struct Usemap Usemap;
+struct Usemap {
+    int l[Maxarg + 1]; /* location of arg used in instruction's arg list */
+    int r[Maxarg + 1]; /* list of registers used implicitly by instruction */
 };
 
 static void printedge(FILE *fd, char *msg, size_t a, size_t b);
 
-Usage usetab[] = {
+/* tables of uses/defs by instruction */
+Usemap usetab[] = {
 #define Use(...) {__VA_ARGS__}
 #define Insn(i, fmt, use, def) use,
 #include "insns.def"
@@ -28,7 +29,7 @@
 #undef Use
 };
 
-Usage deftab[] = {
+Usemap deftab[] = {
 #define Def(...) {__VA_ARGS__}
 #define Insn(i, fmt, use, def) def,
 #include "insns.def"
@@ -36,6 +37,7 @@
 #undef Def
 };
 
+/* A map of which registers interfere */
 Reg regmap[][Nmode] = {
     [0]  = {Rnone, Ral, Rax, Reax, Rrax},
     [1]  = {Rnone, Rcl, Rcx, Recx, Rrcx},
@@ -53,6 +55,7 @@
     [13]  = {Rnone, R15b, R15w, R15d, R15},
 };
 
+/* Which regmap entry a register maps to */
 int colourmap[Nreg] = {
     /* byte */
     [Ral] = 0,
--- a/libstd/alloc.myr
+++ b/libstd/alloc.myr
@@ -103,6 +103,7 @@
 	for i = 0; i < n; i++
 		new[i] = sl[i]
 	;;
+	slfree(sl)
 	-> new
 }