omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / aienux / connector / gates / hostile / memhog.om
| 1 | note hostile probe: touch 192 MiB of memory (12 arrays of 16 MiB); prints how many MiB it touched |
| 2 | global g0 uchar 16777216 |
| 3 | global g1 uchar 16777216 |
| 4 | global g2 uchar 16777216 |
| 5 | global g3 uchar 16777216 |
| 6 | global g4 uchar 16777216 |
| 7 | global g5 uchar 16777216 |
| 8 | global g6 uchar 16777216 |
| 9 | global g7 uchar 16777216 |
| 10 | global g8 uchar 16777216 |
| 11 | global g9 uchar 16777216 |
| 12 | global g10 uchar 16777216 |
| 13 | global g11 uchar 16777216 |
| 14 | text m1 "touched MiB " |
| 15 | text nl "\n" |
| 16 | fn t0 to void |
| 17 | for i ulong 4096 |
| 18 | put g0 mul i 4096 1 |
| 19 | end |
| 20 | end |
| 21 | fn t1 to void |
| 22 | for i ulong 4096 |
| 23 | put g1 mul i 4096 1 |
| 24 | end |
| 25 | end |
| 26 | fn t2 to void |
| 27 | for i ulong 4096 |
| 28 | put g2 mul i 4096 1 |
| 29 | end |
| 30 | end |
| 31 | fn t3 to void |
| 32 | for i ulong 4096 |
| 33 | put g3 mul i 4096 1 |
| 34 | end |
| 35 | end |
| 36 | fn t4 to void |
| 37 | for i ulong 4096 |
| 38 | put g4 mul i 4096 1 |
| 39 | end |
| 40 | end |
| 41 | fn t5 to void |
| 42 | for i ulong 4096 |
| 43 | put g5 mul i 4096 1 |
| 44 | end |
| 45 | end |
| 46 | fn t6 to void |
| 47 | for i ulong 4096 |
| 48 | put g6 mul i 4096 1 |
| 49 | end |
| 50 | end |
| 51 | fn t7 to void |
| 52 | for i ulong 4096 |
| 53 | put g7 mul i 4096 1 |
| 54 | end |
| 55 | end |
| 56 | fn t8 to void |
| 57 | for i ulong 4096 |
| 58 | put g8 mul i 4096 1 |
| 59 | end |
| 60 | end |
| 61 | fn t9 to void |
| 62 | for i ulong 4096 |
| 63 | put g9 mul i 4096 1 |
| 64 | end |
| 65 | end |
| 66 | fn t10 to void |
| 67 | for i ulong 4096 |
| 68 | put g10 mul i 4096 1 |
| 69 | end |
| 70 | end |
| 71 | fn t11 to void |
| 72 | for i ulong 4096 |
| 73 | put g11 mul i 4096 1 |
| 74 | end |
| 75 | end |
| 76 | fn main to int |
| 77 | d = new uchar 8 0 |
| 78 | t0 |
| 79 | t1 |
| 80 | t2 |
| 81 | t3 |
| 82 | t4 |
| 83 | t5 |
| 84 | t6 |
| 85 | t7 |
| 86 | t8 |
| 87 | t9 |
| 88 | t10 |
| 89 | t11 |
| 90 | k = write 1 m1 0 len m1 |
| 91 | put d 0 49 |
| 92 | put d 1 57 |
| 93 | put d 2 50 |
| 94 | k = write 1 d 0 3 |
| 95 | k = write 1 nl 0 len nl |
| 96 | ret 0 |
| 97 | end |