//
// BDW GC
// 

#include "../comnhdr.h"

#define GC_DLL
#define GC_WIN32_THREADS
#include "gc.h"
#pragma comment(lib, "bdwgc.lib")

int main () {
	GC_INIT();
	for (int j = 0; j < 10; j++) {
		BenchTicks_t bt = BenchTicksGetCurrent();
		for (int i = 0; i < 1000; i++) {
			// GC_MALLOC(500*1024);   
			//		^-- note: The returned object is cleared no matter the client 
			//		wants or not. See:
			//			http://www.hpl.hp.com/personal/Hans_Boehm/gc/faq.html

			GC_MALLOC_ATOMIC(500*1024);
			//			^--- This xxx_ATOMIC version will not clear the memory 
			//		returned, and should not contain any pointers.
		}
		bt = BenchTicksGetCurrent() - bt;
		printf("Completed in %s\n", BenchTicksToString(bt, false));
	}
	return 0;
}

