// GLMakeCurrent sets up an OpenGL context for rendering into an OpenGL window.
// (https://wiki.libsdl.org/SDL_GL_MakeCurrent)
12284
func (window *Window) GLMakeCurrent(glcontext GLContext) error {
	return errorFromInt(int(
		C.SDL_GL_MakeCurrent(window.cptr(), C.SDL_GLContext(glcontext))))
}
174581
func (c *InstanceCache) GC(ctx context.Context, now time.Time) {
	c.withState(ctx, now, func(s *messages.InstanceCache) {
		c.gc(ctx, s, now)
	})
}
758203
func (s *UpdateDataRetentionInput) SetCurrentVersion(v string) *UpdateDataRetentionInput {
	s.CurrentVersion = &v
	return s
}
942300
func goFinalizeCall(cCtx *C.duk_context) {
	d := contextFromPointer(cCtx)

	funPtr, ctx := d.getFunctionPtrs()
	d.transmute(unsafe.Pointer(ctx))

	d.fnIndex.delete(funPtr)
}
1017074
func (dl *DaemonLocal) SetCurrentMerkleRoot(
	root keybase1.MerkleRootV2, rootTime time.Time) {
	dl.lock.Lock()
	defer dl.lock.Unlock()
	dl.merkleRoot = root
	dl.merkleTime = rootTime
}
634366
func (s *ClusterServer) InspectCurrent(
	ctx context.Context,
	req *api.SdkClusterInspectCurrentRequest,
) (*api.SdkClusterInspectCurrentResponse, error) {
	if s.cluster() == nil {
		return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
	}

	c, err := s.cluster().Enumerate()
	if err != nil {
		return nil, status.Error(codes.Internal, err.Error())
	}

	// Get cluster information
	cluster := c.ToStorageCluster()

	// Get cluster unique id
	cluster.Id = s.cluster().Uuid()

	return &api.SdkClusterInspectCurrentResponse{
		Cluster: cluster,
	}, nil
}
283002
func (s *EC2InstanceDetails) SetCurrentGeneration(v bool) *EC2InstanceDetails {
	s.CurrentGeneration = &v
	return s
}
257485
func (cm *ClientManager) SetRechargeCurve(curve PieceWiseLinear) {
	cm.lock.Lock()
	defer cm.lock.Unlock()

	now := cm.clock.Now()
	cm.updateRecharge(now)
	cm.updateCapFactor(now, false)
	cm.curve = curve
	if len(curve) > 0 {
		cm.totalRecharge = curve[len(curve)-1].Y
	} else {
		cm.totalRecharge = 0
	}
	cm.refreshCapacity()
}
543809
func (w *Window) GetGLXWindow() C.GLXWindow {
	ret := C.glfwGetGLXWindow(w.data)
	panicError()
	return ret
}
874097
func (cfg *leafNodeCfg) getCurrentURL() *url.URL {
	cfg.RLock()
	defer cfg.RUnlock()
	return cfg.curURL
}
627426
func (dl *DaemonLocal) GetCurrentMerkleRoot(ctx context.Context) (
	keybase1.MerkleRootV2, time.Time, error) {
	if err := checkContext(ctx); err != nil {
		return keybase1.MerkleRootV2{}, time.Time{}, err
	}

	dl.lock.Lock()
	defer dl.lock.Unlock()
	return dl.merkleRoot, dl.merkleTime, nil
}
595301
func (w *Window) GetGLXContext() C.GLXContext {
	ret := C.glfwGetGLXContext(w.data)
	panicError()
	return ret
}
1154640
func (hc *HeaderChain) SetCurrentHeader(head *types.Header) {
	rawdb.WriteHeadHeaderHash(hc.chainDb, head.Hash())

	hc.currentHeader.Store(head)
	hc.currentHeaderHash = head.Hash()
}
61591
func (iter *Iterator) CurrentBuffer() string {
	peekStart := iter.head - 10
	if peekStart < 0 {
		peekStart = 0
	}
	return fmt.Sprintf("parsing #%v byte, around ...|%s|..., whole buffer ...|%s|...", iter.head,
		string(iter.buf[peekStart:iter.head]), string(iter.buf[0:iter.tail]))
}
1226513
func gcasRead(in *iNode, ctrie *Ctrie) *mainNode {
	m := (*mainNode)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&in.main))))
	prev := (*mainNode)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(&m.prev))))
	if prev == nil {
		return m
	}
	return gcasComplete(in, m, ctrie)
}
1135968
func (m *LRUCacher) GC() {
	//fmt.Println("begin gc ...")
	//defer fmt.Println("end gc ...")
	m.mutex.Lock()
	defer m.mutex.Unlock()
	var removedNum int
	for e := m.idList.Front(); e != nil; {
		if removedNum <= core.CacheGcMaxRemoved &&
			time.Now().Sub(e.Value.(*idNode).lastVisit) > m.Expired {
			removedNum++
			next := e.Next()
			//fmt.Println("removing ...", e.Value)
			node := e.Value.(*idNode)
			m.delBean(node.tbName, node.id)
			e = next
		} else {
			//fmt.Printf("removing %d cache nodes ..., left %d\n", removedNum, m.idList.Len())
			break
		}
	}

	removedNum = 0
	for e := m.sqlList.Front(); e != nil; {
		if removedNum <= core.CacheGcMaxRemoved &&
			time.Now().Sub(e.Value.(*sqlNode).lastVisit) > m.Expired {
			removedNum++
			next := e.Next()
			//fmt.Println("removing ...", e.Value)
			node := e.Value.(*sqlNode)
			m.delIds(node.tbName, node.sql)
			e = next
		} else {
			//fmt.Printf("removing %d cache nodes ..., left %d\n", removedNum, m.sqlList.Len())
			break
		}
	}
}
860336
func (v *Notebook) SetCurrentPage(pageNum int) {
	C.gtk_notebook_set_current_page(NOTEBOOK(v), gint(pageNum))
}