func (r *registrar) MakeRef() (ref etf.Ref) {
	ref.Node = etf.Atom(r.nodename)
	ref.Creation = r.creation
	nt := atomic.AddUint64(&r.uniqID, 1)
	ref.ID[0] = uint32(uint64(nt) & ((2 << 17) - 1))
	ref.ID[1] = uint32(uint64(nt) >> 46)
	return
}
MakeRef returns atomic reference etf.Ref within this node
package node
import (
	"context"
	"fmt"
	"runtime"
	"sync"
	"sync/atomic"
	"time"
	"github.com/ergo-services/ergo/etf"
	"github.com/ergo-services/ergo/gen"
	"github.com/ergo-services/ergo/lib"
)
const (
	startPID = 1000
)
type registrar struct {
	monitor
	ctx context.Context
	nextPID  uint64
	uniqID   uint64
	nodename string
	creation uint32
	net  networkInternal
	node nodeInternal
	names          map[string]etf.Pid
	mutexNames     sync.Mutex
	aliases        map[etf.Alias]*process
	mutexAliases   sync.Mutex
	processes      map[uint64]*process
	mutexProcesses sync.Mutex
	peers          map[string]*peer
	mutexPeers     sync.Mutex
	behaviors      map[string]map[string]gen.RegisteredBehavior
	mutexBehaviors sync.Mutex
}
type registrarInternal interface {
	gen.Registrar
	monitorInternal
	spawn(name string, opts processOptions, behavior gen.ProcessBehavior, args ...etf.Term) (gen.Process, error)
	registerName(name string, pid etf.Pid) error
	unregisterName(name string) error
	registerPeer(peer *peer) error
	unregisterPeer(name string)
	newAlias(p *process) (etf.Alias, error)
	deleteAlias(owner *process, alias etf.Alias) error
	getProcessByPid(etf.Pid) *process
	route(from etf.Pid, to etf.Term, message etf.Term) error
	routeRaw(nodename etf.Atom, messages ...etf.Term) error
}
func newRegistrar(ctx context.Context, nodename string, creation uint32, node nodeInternal) registrarInternal {
	r := &registrar{
		ctx:       ctx,
		nextPID:   startPID,
		uniqID:    uint64(time.Now().UnixNano()),
		net:       node.(networkInternal),
		node:      node.(nodeInternal),
		nodename:  nodename,
		creation:  creation,
		names:     make(map[string]etf.Pid),
		aliases:   make(map[etf.Alias]*process),
		processes: make(map[uint64]*process),
		peers:     make(map[string]*peer),
		behaviors: make(map[string]map[string]gen.RegisteredBehavior),
	}
	r.monitor = newMonitor(r)
	return r
}
func (r *registrar) NodeName() string {
	return r.node.Name()
}
func (r *registrar) NodeStop() {
	r.node.Stop()
}
func (r *registrar) newPID() etf.Pid {
	i := atomic.AddUint64(&r.nextPID, 1)
	return etf.Pid{
		Node:     etf.Atom(r.nodename),
		ID:       i,
		Creation: r.creation,
	}
}