func allocDecoderMemory(n int) unsafe.Pointer {
	mem, err := C.calloc(C.size_t(n), (C.size_t)(sizeOfDecoderValue))
	if err != nil {
		panic("memory alloc error: " + err.Error())
	}
	return mem
}
allocDecoderMemory allocates memory for type C.ps_decoder_t in C.
The caller is responsible for freeing the this memory via C.free.
package pocketsphinx
import "C"
import (
	"runtime"
	"sync"
	"unsafe"
)
func (x *Decoder) Ref() *C.ps_decoder_t {
	if x == nil {
		return nil
	}
	return (*C.ps_decoder_t)(unsafe.Pointer(x))
}
func (x *Decoder) Free() {
	if x != nil {
		C.free(unsafe.Pointer(x))
	}
}
func NewDecoderRef(ref unsafe.Pointer) *Decoder {
	return (*Decoder)(ref)
}
func NewDecoder() *Decoder {
	return (*Decoder)(allocDecoderMemory(1))
}