ref: 4932534d5f4a6cba82ce1a0a67b6b84cbe6bfa26
parent: ebabe7af835cc3a5181a0af4cb6612e54ec2af02
author: Ori Bernstein <[email protected]>
date: Sat Jul 21 16:03:53 EDT 2012
Add missing file.
--- a/alloc.myr
+++ b/alloc.myr
@@ -25,9 +25,9 @@
;;
type slab = struct
- freehd : bin*
- next : slab*
- nfree : size
+ freehd : bin* /* the nodes we're allocating */
+ next : slab* /* the next slab on the chain */
+ nfree : size /* the number of free nodes */
;;
type bin = struct
--- /dev/null
+++ b/die.myr
@@ -1,0 +1,19 @@
+use "sys.use"
+use "types.use"
+
+pkg std =
+ const die : (msg : byte[,] -> void)
+ const assert : (cond : bool, msg : byte[,] -> void)
+;;
+
+const die = {msg
+ write(2, msg)
+ kill(getpid(), 6)
+}
+
+const assert = {cond, msg
+ if cond
+ die(msg)
+ ;;
+}
+