public int GetFreeIndex()
{
//idea: use chache-oblivious placing (?)
int index;
if (this.FreeIndices.Count > 0)
{
index = this.FreeIndices.Dequeue();
}
else {
if (this.Nodes.Length <= this.FirstFreeIndex) {
this.Resize();
}
index = this.FirstFreeIndex;
this.FirstFreeIndex++;
}
return index;
}