Skip to content

Instantly share code, notes, and snippets.

@bkerley
Created July 21, 2008 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bkerley/48 to your computer and use it in GitHub Desktop.
Save bkerley/48 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#define BLOCKS 8192
#define BLOCKSIZE 8192
int main() {
int* blocks[BLOCKS];
int i;
for (i=0;i<BLOCKS;i++) {
blocks[i] = (int*)calloc(BLOCKSIZE,sizeof(int));
}
while (1) {
i = blocks[rand()%BLOCKS][rand()%BLOCKSIZE];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment