func newNode(key Item, value interface{}) *Node {
	m.Lock()
	if nil == pool {
		if 0 != freeNodes {
			panic("pool corrupt")
		}
		totalNodes += 1
		m.Unlock()
		return &Node{
			key:     key,
			value:   value,
			balance: 0,
		}
	}
	p := pool
	pool = p.up
	p.key = key
	p.value = value
	p.balance = 0
	p.leftNodes = 0
	p.rightNodes = 0
	p.left = nil
	p.right = nil
	p.up = nil  
	freeNodes -= 1
	m.Unlock()
	return p
}
allocate a new node, reuses reclaimed nodes if any are available
package avl
import (
	"sync"
)
type Item interface {
	Compare(interface{}) int  
}
type Node struct {
	left       *Node        
	right      *Node        
	up         *Node        
	key        Item         
	value      interface{}  
	leftNodes  int          
	rightNodes int          
	balance    int          
}
var m sync.Mutex    
var pool *Node      
var totalNodes int  
var freeNodes int   