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: checklocks_on_unsafe.go
    path of file: ./repos/sliver/vendor/gvisor.dev/gvisor/pkg/sync
    
    the code of the file until where you have to start completion: // Copyright 2020 The gVisor Authors.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build checklocks
// +build checklocks

package sync

import (
	"fmt"
	"strings"
	"sync"
	"unsafe"

	"gvisor.dev/gvisor/p
    
func getGLocks() *gLocks {
	id := goid.Get()

	var locks *gLocks
	if l, ok := locksHeld.Load(id); ok {
		locks = l.(*gLocks)
	} else {
		locks = &gLocks{
			// Initialize space for a few locks.
			locksHeld: make([]unsafe.Pointer, 0, 8),
		}
		locksHeld.Store(id, locks)
	}

	return locks
}