You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: memory.go
    path of file: ./repos/frostdb/query
    
    the code of the file until where you have to start completion: package query

import (
	"runtime/debug"
	"sync/atomic"

	"github.com/apache/arrow/go/v15/arrow/memory"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promauto"
)

const PanicMemoryLimit = "memory limit exceeded"

var _ memory.Allocator = (*LimitAllocator)(nil)

// LimitAllocator is a wrapper around a memory.Allocator that panics if the 
    
func NewLimitAllocator(limit int64, allocator memory.Allocator, options ...AllocatorOption) *LimitAllocator {
	l := &LimitAllocator{
		limit:     limit,
		allocated: &atomic.Int64{},
		allocator: allocator,
		reg:       prometheus.NewRegistry(),
	}

	for _, option := range options {
		option(l)
	}

	promauto.With(l.reg).NewGaugeFunc(prometheus.GaugeOpts{
		Name: "memory_allocated_bytes",
		Help: "The total number of bytes allocated by the allocator.",
	}, func() float64 {
		return float64(l.allocated.Load())
	})

	return l
}