Centralize things

This commit is contained in:
Christine Dodrill 2015-06-05 19:11:44 -07:00
parent b4b2d8cec0
commit bb57350e55
9 changed files with 35 additions and 6 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/.tup
/bin

View File

@ -1,5 +0,0 @@
.gitignore
include_rules
: crypt.nim |> !nim |> crypt
: crack.nim |> !nim |> crack

View File

@ -3,4 +3,4 @@ NIMFLAGS += --deadcodeElim:on
#NIMFLAGS += -d:release
NIMFLAGS += --verbosity:0
!nim = |> nim c $(NIMFLAGS) %f && rm -rf .nimcache |>
!nim = |> nim c $(NIMFLAGS) -o:%o %f && rm -rf .nimcache |>

6
src/Tupfile Normal file
View File

@ -0,0 +1,6 @@
.gitignore
include_rules
: crypt.nim |> !nim |> ../bin/crypt
: crack.nim |> !nim |> ../bin/crack
: reaper.c |> gcc -o %o %f |> ../bin/reaper

26
src/reaper.c Normal file
View File

@ -0,0 +1,26 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define AMOUNT 1024*1024*1024
void * mem[16];
int main() {
int i;
for(i=0; i < 16; i++) {
mem[i] = malloc(AMOUNT); // One gigabyte XXX do not do this
memset(mem[i], 0, AMOUNT);
printf("Allocated %d GB of ram...\n", i+1);
}
printf("16 GB of memory used, waiting for input... ");
while(1) {
printf("Trashing ram use...\n");
for(i=0; i < 16; i++) {
memcpy(mem[i], mem[(i+1)%16], AMOUNT);
}
}
}