Index: src/examples/gc_no_raii/src/internal/collector.c
===================================================================
--- src/examples/gc_no_raii/src/internal/collector.c	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
+++ src/examples/gc_no_raii/src/internal/collector.c	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
@@ -0,0 +1,142 @@
+#include "collector.h"
+
+#include <stdint.h>
+#include <string.h>
+
+#include "fstream.h"
+
+#include "gc_tools.h"
+#include "state.h"
+#include "memory_pool.h"
+
+void* gc_finish_alloc_block(void* block, size_t actual_size, size_t target_size);
+void gc_assign_reference(void** ref, gc_object_header* ptr);
+
+gcpointer_t** gc_find_previous_ref(gcpointer_t* target)
+{
+	if(!(target)) return NULL;
+
+	bool managed = gc_is_managed(target);
+	gc_object_header* obj = gc_get_object_ptr(target->ptr);
+
+	check(gc_is_valide(obj));
+
+	gcpointer_t** prev_next_ptr = managed ? &obj->type_chain : &obj->root_chain;
+	while((*prev_next_ptr) && (*prev_next_ptr) != target)
+	{
+		prev_next_ptr = &(*prev_next_ptr)->next;
+	}
+
+	return prev_next_ptr;
+}
+
+void* gc_allocate(size_t target_size)
+{
+	size_t size = gc_compute_size(target_size + sizeof(gc_object_header));
+
+	check(size < POOL_SIZE_BYTES);
+
+	void* block = nullptr;
+	gc_state* gc = gc_get_state();
+
+	if((block = gc_try_allocate(gc, size))) return gc_finish_alloc_block(block, size, target_size);
+
+	gc_collect(gc);
+
+	if((block = gc_try_allocate(gc, size))) return gc_finish_alloc_block(block, size, target_size);
+
+	gc_allocate_pool(gc);
+
+	if((block = gc_try_allocate(gc, size))) return gc_finish_alloc_block(block, size, target_size);
+
+	ofstream_stderr() | "ERROR: allocation in new pool failed" | endl;
+	abort();
+
+	return nullptr;
+}
+
+void* gc_finish_alloc_block(void* block, size_t actual_size, size_t target_size)
+{
+	void* data = (void*)(intptr_t(block) + sizeof(object_header));
+	void* header = block;
+
+	check(intptr_t(data) > intptr_t(block));
+	check(intptr_t(data) >= intptr_t(header));
+	check(is_aligned(data));
+	check(intptr_t(data) + target_size <= intptr_t(block) + actual_size);
+
+	object_header* obj = gc_object_header_placement_ctor(header, actual_size);
+
+	(void)obj; //remove unsused warning since this is for debug
+	check(obj == get_object_ptr(data));
+
+	gc_register_allocation(get_state(), actual_size);
+
+	return data;
+}
+
+// 	void process_reference(void** ref, std::vector<void**>& worklist)
+// 	{
+// 		check(!gc::get_state().is_in_heap(ref));
+//
+// 		if(object_header* ptr = get_object_ptr(*ref))
+// 		{
+// 			if(!ptr->is_forwarded)
+// 			{
+// 				copy_object(ptr);
+//
+// 				scan_object(ptr->forward, worklist);
+//
+// 				assign_reference(ref, ptr->forward);
+// 			}
+// 			else
+// 			{
+// 				//duplication to help debug
+// 				assign_reference(ref, ptr->forward);
+// 			}
+// 		}
+// 	}
+//
+// 	void assign_reference(void** ref, object_header* ptr)
+// 	{
+// 		void* address = (void*)(intptr_t(ptr) + sizeof(object_header));
+//
+// 		write_aligned_ptr(ref, address);
+// 	}
+//
+// 	object_header* copy_object(object_header* ptr)
+// 	{
+// 		check(!ptr->forward);
+// 		check(!ptr->is_forwarded);
+// 		check(pool_of(ptr)->is_from_space());
+//
+// 		memory_pool* pool = pool_of(ptr)->mirror();
+//
+// 		void* new_block = pool->allocate(ptr->size, false);
+//
+// 		std::memcpy(new_block, ptr, ptr->size);
+//
+// 		object_header* fwd_ptr = new (new_block) object_header(ptr);
+//
+// 		ptr->forward = fwd_ptr;
+// 		ptr->is_forwarded = true;
+//
+// 		return fwd_ptr;
+// 	}
+//
+// 	void scan_object(object_header* object, std::vector<void**>& worklist)
+// 	{
+// 		gcpointer_base* type = object->type_chain;
+// 		while(type)
+// 		{
+// 			check(intptr_t(type) > intptr_t(object));
+// 			check(intptr_t(type) < intptr_t(intptr_t(object) + object->size));
+//
+// 			check(gc::get_state().is_in_to_space(&type->m_ptr));
+//
+// 			worklist.push_back(&type->m_ptr);
+//
+// 			type = type->m_next;
+// 		}
+// 	}
+// };
Index: src/examples/gc_no_raii/src/internal/collector.h
===================================================================
--- src/examples/gc_no_raii/src/internal/collector.h	(revision a2b2761456045c52741a58f2397c74bcfbf3c113)
+++ src/examples/gc_no_raii/src/internal/collector.h	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
@@ -20,11 +20,11 @@
 }
 
-inline struct gc_object_header* gc_get_object_ptr(void* ptr)
+inline gc_object_header* gc_get_object_ptr(void* ptr)
 {
 	void* clean = gc_get_aligned_ptr(ptr);
-	return ((struct gc_object_header*)clean) - 1;
+	return ((gc_object_header*)clean) - 1;
 }
 
-inline struct gc_memory_pool* pool_of(void* address)
+inline gc_memory_pool* pool_of(void* address)
 {
 	return (struct gc_memory_pool*)(((intptr_t)address) & POOL_PTR_MASK);
Index: src/examples/gc_no_raii/src/internal/globals.h
===================================================================
--- src/examples/gc_no_raii/src/internal/globals.h	(revision a2b2761456045c52741a58f2397c74bcfbf3c113)
+++ src/examples/gc_no_raii/src/internal/globals.h	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
@@ -1,16 +1,29 @@
 #pragma once
 
-#include <stddef.h>
-#include <stdint.h>
+// #include <stddef.h>
+// #include <stdint.h>
+//
+// static const size_t POOL_SIZE_EXP = 24;
+// static const size_t POOL_SIZE_BYTES = 0x1 << POOL_SIZE_EXP;
+// static const size_t POOL_PTR_MASK = ~(POOL_SIZE_BYTES - 1);
+//
+// static const size_t CARDS_SIZE_EXP = 12;
+// static const size_t CARDS_SIZE_BYTES = 0x1 << CARDS_SIZE_EXP;
+// static const size_t CARDS_OFFSET_MASK = (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1);
+// static const size_t CARDS_COUNT = POOL_SIZE_BYTES / CARDS_SIZE_BYTES;
+//
+// static const size_t OBJECT_ALLIGNMENT = sizeof(size_t);
+// static const size_t OBJECT_PTR_MASK = ~(OBJECT_ALLIGNMENT - 1);
 
-static const size_t POOL_SIZE_EXP = 24;
-static const size_t POOL_SIZE_BYTES = 0x1 << POOL_SIZE_EXP;
-static const size_t POOL_PTR_MASK = ~(POOL_SIZE_BYTES - 1);
 
-static const size_t CARDS_SIZE_EXP = 12;
-static const size_t CARDS_SIZE_BYTES = 0x1 << CARDS_SIZE_EXP;
-static const size_t CARDS_OFFSET_MASK = (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1);
-static const size_t CARDS_COUNT = POOL_SIZE_BYTES / CARDS_SIZE_BYTES;
+#define POOL_SIZE_EXP 24
+#define POOL_SIZE_BYTES 0x1 << POOL_SIZE_EXP
+#define POOL_PTR_MASK ~(POOL_SIZE_BYTES - 1)
 
-static const size_t OBJECT_ALLIGNMENT = sizeof(size_t);
-static const size_t OBJECT_PTR_MASK = ~(OBJECT_ALLIGNMENT - 1);
+#define CARDS_SIZE_EXP 12
+#define CARDS_SIZE_BYTES 0x1 << CARDS_SIZE_EXP
+#define CARDS_OFFSET_MASK (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1)
+#define CARDS_COUNT POOL_SIZE_BYTES / CARDS_SIZE_BYTES
+
+#define OBJECT_ALLIGNMENT sizeof(size_t)
+#define OBJECT_PTR_MASK ~(OBJECT_ALLIGNMENT - 1)
Index: src/examples/gc_no_raii/src/internal/object_header.h
===================================================================
--- src/examples/gc_no_raii/src/internal/object_header.h	(revision a2b2761456045c52741a58f2397c74bcfbf3c113)
+++ src/examples/gc_no_raii/src/internal/object_header.h	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
@@ -6,22 +6,27 @@
 #include "tools.h"
 
-static const void* CANARY_VALUE = (void*)0xCAFEBABACAFEBABA;
+#if DEBUG
+	static const void* CANARY_VALUE = (void*)0xCAFEBABACAFEBABA;
+#endif
 
 struct gcpointer_t;
+struct gc_object_header;
 
 struct gc_object_header
 {
-	#if _DEBUG
+	#if DEBUG
 		void* canary_start;
 	#endif
 
-	size_t				size;
-	gcpointer_t* 			root_chain;
-	gcpointer_t*			type_chain;
-	struct gc_object_header*	forward;
-	bool					is_forwarded;
+	size_t		size;
+	gcpointer_t* 	root_chain;
+	gcpointer_t*	type_chain;
+	gc_object_header*	forward;
+	bool			is_forwarded;
 
-	#if _DEBUG
+	#if DEBUG
 		void* canary_end;
 	#endif
 };
+
+gc_object_header* gc_object_header_placement_ctor(void* address, size_t size);
Index: src/examples/gc_no_raii/src/internal/state.c
===================================================================
--- src/examples/gc_no_raii/src/internal/state.c	(revision a2b2761456045c52741a58f2397c74bcfbf3c113)
+++ src/examples/gc_no_raii/src/internal/state.c	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
@@ -1,9 +1,6 @@
-#include "state.hpp"
-
-#include <algorithm>
-#include <iostream>
+#include "state.h"
 
 //general purpouse includes
-#include "tools.hpp"
+#include "tools.h"
 
 //platform abstraction includes
@@ -11,266 +8,266 @@
 
 //gc internal includes
-#include "globals.hpp"
-#include "memory_pool.hpp"
-#include "memory_pool_iterator.hpp"
-#include "object_header.hpp"
-
-void swap(gc_state* state);
-void sweep_roots(worklist_t worklist);
-void clear(gc_state* state);
-void calc_usage(gc_state* state);
-
-#if DEBUG
-	bool roots_match(gc_state* state);
-	bool no_from_space_ref(gc_state* state);
-#endif
-
-void gc_state_ctor(gc_state* state)
-{
-	state->from_code(0)
-	state->to_space(nullptr)
-	state->from_space(nullptr)
-	state->total_space(0)
-	state->used_space(0)
-	state->pools_table()
-
-	gc_allocate_pool(gc_state* state);
-}
-
-bool state::is_in_heap(void* address) const
-{
-	memory_pool* target_pool = pool_of(address);
-
-	auto first = pools_table.cbegin();
-	auto last = pools_table.cend();
-	auto result = std::find(first, last, target_pool);
-	return result != last && (*result)->is_from_space();
-}
-
-bool state::is_in_to_space(void* address) const
-{
-	const memory_pool* target_pool = pool_of(address);
-
-	auto first = pools_table.cbegin();
-	auto last = pools_table.cend();
-	auto result = std::find(first, last, target_pool);
-	return result != last && !(*result)->is_from_space();
-}
-
-object_header* state::get_object_for_ref(void* member)
-{
-	intptr_t target = intptr_t(member);
-	if(!is_in_heap(member)) return nullptr;
-
-	memory_pool* pool = pool_of(member);
-	auto it = pool->iterator_for(member);
-	auto end = pool->end();
-
-	while(it != end)
-	{
-		object_header* object = *it;
-		{
-			intptr_t start = intptr_t(object);
-			intptr_t end = intptr_t(start + object->size);
-			if(start < target && end > target)
-			{
-				return object;
-			}
-		}
-		++it;
-	}
-
-	checkf(false, "is_in_heap() and iterator_for() return inconsistent data");
-	abort();
-	return nullptr;
-}
-
-void* state::try_allocate(size_t size)
-{
-	memory_pool* pool = from_space;
-	while(pool)
-	{
-		if(pool->size_left() > size)
-		{
-			return pool->allocate(size, true);
-		}
-		pool = pool->next();
-	}
-
-	return nullptr;
-}
-
-void state::allocate_pool()
-{
-	memory_pool* old_from_space = from_space;
-      memory_pool* old_to_space = to_space;
-
-      from_space = reinterpret_cast<memory_pool*>(pal_allocPool(POOL_SIZE_BYTES, 1));
-      to_space = reinterpret_cast<memory_pool*>(pal_allocPool(POOL_SIZE_BYTES, 1));
-
-      new (from_space) memory_pool(POOL_SIZE_BYTES, old_from_space, to_space, from_code);
-      new (to_space) memory_pool(POOL_SIZE_BYTES, old_to_space, from_space, (~from_code) & 0x01);
-
-	total_space += from_space->size();
-
-	pools_table.push_back(from_space);
-	pools_table.push_back(to_space);
-}
-
-void state::collect()
-{
-	DEBUG("collecting");
-	DEBUG("previous usage " << used_space << " / " << total_space);
-
-	std::vector<void**> worklist;
-	sweep_roots(worklist);
-
-	while(!worklist.empty())
-	{
-		void** ref = worklist.back();
-		worklist.pop_back();
-		process_reference(ref, worklist);
-	}
-
-	check(roots_match());
-	check(no_from_space_ref());
-
-	swap();
-
-	calc_usage();
-
-	if(needs_collect()) allocate_pool();
-
-	DEBUG("done");
-}
-
-void state::swap()
-{
-	std::swap(from_space, to_space);
-
-	memory_pool* pool = to_space;
-	while(pool)
-	{
-		pool->reset();
-		pool = pool->next();
-	}
-
-	from_code = (~from_code) & 0x01;
-
-	#if _DEBUG
-		{
-			memory_pool* pool = from_space;
-			while(pool)
-			{
-				check(pool->is_from_space());
-				pool = pool->next();
-			}
-
-			pool = to_space;
-			while(pool)
-			{
-				check(!pool->is_from_space());
-				pool = pool->next();
-			}
-		}
-	#endif
-}
-
-void state::sweep_roots(std::vector<void**>& worklist)
-{
-	memory_pool* pool = from_space;
-	while(pool)
-	{
-		for(object_header* object : *pool)
-		{
-			if(!object->root_chain) continue;
-
-			copy_object(object);
-
-			scan_object(object->forward, worklist);
-		}
-
-		pool = pool->next();
-	}
-}
-
-void state::clear()
-{
-	memory_pool* pool = from_space;
-	while(pool)
-	{
-		pool->reset();
-		pool = pool->next();
-	}
-
-	pool = to_space;
-	while(pool)
-	{
-		pool->reset();
-		pool = pool->next();
-	}
-}
-
-void state::calc_usage()
-{
-	total_space = 0;
-	used_space = 0;
-
-	memory_pool* pool = from_space;
-	while(pool)
-	{
-		size_t size = pool->size();
-		size_t used = size - pool->size_left();
-		check(used <= size);
-		total_space += size;
-		used_space += used;
-
-		pool = pool->next();
-	}
-}
-
-#if _DEBUG
-	bool state::roots_match()
-	{
-		memory_pool* pool = to_space;
-		while(pool)
-		{
-			size_t size = 0;
-			for(object_header* object : *pool)
-			{
-				size += object->size;
-
-				gcpointer_base* ptr = object->root_chain;
-				while(ptr)
-				{
-					check(get_object_ptr(ptr->m_ptr) == object);
-					ptr = ptr->m_next;
-				}
-			}
-
-			check(size + pool->size_left() == pool->size());
-
-			pool = pool->next();
-		}
-
-		return true;
-	}
-
-	bool state::no_from_space_ref()
-	{
-		memory_pool* pool = to_space;
-		while(pool)
-		{
-			void** potential_ref = (void**)pool->m_start;
-			while(potential_ref < (void**)pool->m_free)
-			{
-				check(!is_in_heap(*potential_ref));
-				potential_ref++;
-			}
-
-			pool = pool->next();
-		}
-
-		return true;
-	}
-#endif
+// #include "globals.h"
+// #include "memory_pool.h"
+// #include "memory_pool_iterator.h"
+// #include "object_header.h"
+//
+// void swap(gc_state* state);
+// void sweep_roots(worklist_t worklist);
+// void clear(gc_state* state);
+// void calc_usage(gc_state* state);
+//
+// #if DEBUG
+// 	bool roots_match(gc_state* state);
+// 	bool no_from_space_ref(gc_state* state);
+// #endif
+//
+// void gc_state_ctor(gc_state* state)
+// {
+// 	state->from_code(0)
+// 	state->to_space(nullptr)
+// 	state->from_space(nullptr)
+// 	state->total_space(0)
+// 	state->used_space(0)
+// 	state->pools_table()
+//
+// 	gc_allocate_pool(gc_state* state);
+// }
+//
+// bool state::is_in_heap(void* address) const
+// {
+// 	memory_pool* target_pool = pool_of(address);
+//
+// 	auto first = pools_table.cbegin();
+// 	auto last = pools_table.cend();
+// 	auto result = std::find(first, last, target_pool);
+// 	return result != last && (*result)->is_from_space();
+// }
+//
+// bool state::is_in_to_space(void* address) const
+// {
+// 	const memory_pool* target_pool = pool_of(address);
+//
+// 	auto first = pools_table.cbegin();
+// 	auto last = pools_table.cend();
+// 	auto result = std::find(first, last, target_pool);
+// 	return result != last && !(*result)->is_from_space();
+// }
+//
+// object_header* state::get_object_for_ref(void* member)
+// {
+// 	intptr_t target = intptr_t(member);
+// 	if(!is_in_heap(member)) return nullptr;
+//
+// 	memory_pool* pool = pool_of(member);
+// 	auto it = pool->iterator_for(member);
+// 	auto end = pool->end();
+//
+// 	while(it != end)
+// 	{
+// 		object_header* object = *it;
+// 		{
+// 			intptr_t start = intptr_t(object);
+// 			intptr_t end = intptr_t(start + object->size);
+// 			if(start < target && end > target)
+// 			{
+// 				return object;
+// 			}
+// 		}
+// 		++it;
+// 	}
+//
+// 	checkf(false, "is_in_heap() and iterator_for() return inconsistent data");
+// 	abort();
+// 	return nullptr;
+// }
+//
+// void* state::try_allocate(size_t size)
+// {
+// 	memory_pool* pool = from_space;
+// 	while(pool)
+// 	{
+// 		if(pool->size_left() > size)
+// 		{
+// 			return pool->allocate(size, true);
+// 		}
+// 		pool = pool->next();
+// 	}
+//
+// 	return nullptr;
+// }
+//
+// void state::allocate_pool()
+// {
+// 	memory_pool* old_from_space = from_space;
+//       memory_pool* old_to_space = to_space;
+//
+//       from_space = reinterpret_cast<memory_pool*>(pal_allocPool(POOL_SIZE_BYTES, 1));
+//       to_space = reinterpret_cast<memory_pool*>(pal_allocPool(POOL_SIZE_BYTES, 1));
+//
+//       new (from_space) memory_pool(POOL_SIZE_BYTES, old_from_space, to_space, from_code);
+//       new (to_space) memory_pool(POOL_SIZE_BYTES, old_to_space, from_space, (~from_code) & 0x01);
+//
+// 	total_space += from_space->size();
+//
+// 	pools_table.push_back(from_space);
+// 	pools_table.push_back(to_space);
+// }
+//
+// void state::collect()
+// {
+// 	DEBUG("collecting");
+// 	DEBUG("previous usage " << used_space << " / " << total_space);
+//
+// 	std::vector<void**> worklist;
+// 	sweep_roots(worklist);
+//
+// 	while(!worklist.empty())
+// 	{
+// 		void** ref = worklist.back();
+// 		worklist.pop_back();
+// 		process_reference(ref, worklist);
+// 	}
+//
+// 	check(roots_match());
+// 	check(no_from_space_ref());
+//
+// 	swap();
+//
+// 	calc_usage();
+//
+// 	if(needs_collect()) allocate_pool();
+//
+// 	DEBUG("done");
+// }
+//
+// void state::swap()
+// {
+// 	std::swap(from_space, to_space);
+//
+// 	memory_pool* pool = to_space;
+// 	while(pool)
+// 	{
+// 		pool->reset();
+// 		pool = pool->next();
+// 	}
+//
+// 	from_code = (~from_code) & 0x01;
+//
+// 	#if _DEBUG
+// 		{
+// 			memory_pool* pool = from_space;
+// 			while(pool)
+// 			{
+// 				check(pool->is_from_space());
+// 				pool = pool->next();
+// 			}
+//
+// 			pool = to_space;
+// 			while(pool)
+// 			{
+// 				check(!pool->is_from_space());
+// 				pool = pool->next();
+// 			}
+// 		}
+// 	#endif
+// }
+//
+// void state::sweep_roots(std::vector<void**>& worklist)
+// {
+// 	memory_pool* pool = from_space;
+// 	while(pool)
+// 	{
+// 		for(object_header* object : *pool)
+// 		{
+// 			if(!object->root_chain) continue;
+//
+// 			copy_object(object);
+//
+// 			scan_object(object->forward, worklist);
+// 		}
+//
+// 		pool = pool->next();
+// 	}
+// }
+//
+// void state::clear()
+// {
+// 	memory_pool* pool = from_space;
+// 	while(pool)
+// 	{
+// 		pool->reset();
+// 		pool = pool->next();
+// 	}
+//
+// 	pool = to_space;
+// 	while(pool)
+// 	{
+// 		pool->reset();
+// 		pool = pool->next();
+// 	}
+// }
+//
+// void state::calc_usage()
+// {
+// 	total_space = 0;
+// 	used_space = 0;
+//
+// 	memory_pool* pool = from_space;
+// 	while(pool)
+// 	{
+// 		size_t size = pool->size();
+// 		size_t used = size - pool->size_left();
+// 		check(used <= size);
+// 		total_space += size;
+// 		used_space += used;
+//
+// 		pool = pool->next();
+// 	}
+// }
+//
+// #if _DEBUG
+// 	bool state::roots_match()
+// 	{
+// 		memory_pool* pool = to_space;
+// 		while(pool)
+// 		{
+// 			size_t size = 0;
+// 			for(object_header* object : *pool)
+// 			{
+// 				size += object->size;
+//
+// 				gcpointer_base* ptr = object->root_chain;
+// 				while(ptr)
+// 				{
+// 					check(get_object_ptr(ptr->m_ptr) == object);
+// 					ptr = ptr->m_next;
+// 				}
+// 			}
+//
+// 			check(size + pool->size_left() == pool->size());
+//
+// 			pool = pool->next();
+// 		}
+//
+// 		return true;
+// 	}
+//
+// 	bool state::no_from_space_ref()
+// 	{
+// 		memory_pool* pool = to_space;
+// 		while(pool)
+// 		{
+// 			void** potential_ref = (void**)pool->m_start;
+// 			while(potential_ref < (void**)pool->m_free)
+// 			{
+// 				check(!is_in_heap(*potential_ref));
+// 				potential_ref++;
+// 			}
+//
+// 			pool = pool->next();
+// 		}
+//
+// 		return true;
+// 	}
+// #endif
Index: src/examples/gc_no_raii/src/internal/state.h
===================================================================
--- src/examples/gc_no_raii/src/internal/state.h	(revision a2b2761456045c52741a58f2397c74bcfbf3c113)
+++ src/examples/gc_no_raii/src/internal/state.h	(revision 6be0cf9f958cd6a2f2ed0607c27023b9a65c146e)
@@ -20,14 +20,14 @@
 };
 
-void gc_state_ctor(gc_state* state);
+void gc_state_ctor(struct gc_state* state);
 
-inline gc_state* get_state()
+static inline gc_state* gc_get_state()
 {
 	static gc_state s;
-	if(!s.is_initialized) gc_state_ctor(s);
+	if(!s.is_initialized) gc_state_ctor(&s);
 	return &s;
 }
 
-inline bool needs_collect(gc_state* state)
+inline bool gc_needs_collect(gc_state* state)
 {
 	return state->used_space * 2 > state->total_space;
