projects
/
cacao.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Files missed in the Boehm-GC 7.1 import (sorry).
[cacao.git]
/
src
/
mm
/
boehm-gc
/
tests
/
smash_test.c
1
/*
2
* Test that overwrite error detection works reasonably.
3
*/
4
#define GC_DEBUG
5
#include <gc.h>
6
#include <stdio.h>
7
8
#define COUNT 7000
9
#define SIZE 40
10
11
char * A[COUNT];
12
13
int main ()
14
{
15
int i;
16
char *p;
17
18
GC_INIT();
19
20
for (i = 0; i < COUNT; ++i) {
21
A[i] = p = GC_MALLOC(SIZE);
22
23
if (i%3000 == 0) GC_gcollect();
24
if (i%5678 == 0) p[SIZE + i/2000] = 42;
25
}
26
return 0;
27
}
28