summaryrefslogtreecommitdiff
path: root/tests/methods/parameter-ref-array-resize-captured.vala
blob: 19fd6390baee9787c362f241a9d7b28e63267e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
delegate void FooFunc ();

void foo (ref int[] a) {
	a = new int[1];
}

void main() {
	int[] a = new int[10 * 1024 * 1024];

	FooFunc func = () => {
		foo (ref a);
	};
	func ();

	for (int i = 1; i < 10 * 1024 * 1024; i++) {
		a += 4711;
	}
}