mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
5dee2e3b8b
* Create package.yml * Create test.cc
16 lines
346 B
C++
16 lines
346 B
C++
#include <assert.h>
|
|
#include <stdio.h>
|
|
#include "gc.h"
|
|
|
|
int main(void) {
|
|
int i;
|
|
|
|
GC_INIT();
|
|
for (i = 0; i < 10000000; ++i) {
|
|
int **p = (int **) GC_MALLOC(sizeof(int *));
|
|
int *q = (int *) GC_MALLOC_ATOMIC(sizeof(int));
|
|
assert(*p == 0);
|
|
*p = (int *) GC_REALLOC(q, 2 * sizeof(int));
|
|
}
|
|
return 0;
|
|
}
|