diff options
author | Russ Cox <rsc@golang.org> | 2014-11-11 17:05:37 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-11-11 17:05:37 -0500 |
commit | 4341f082b01ba446d416cb5cbaacc55ff0fefe13 (patch) | |
tree | b8b1cdd1a626b458c95ce044a1a741e2a0330a2a /src/runtime/cgo.go | |
parent | f693cb489b88fb4ac9aab878cdc62629021c5bf4 (diff) | |
download | go-4341f082b01ba446d416cb5cbaacc55ff0fefe13.tar.gz |
[dev.cc] runtime/cgo: convert from C to Go
The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.
[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]
LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/168500043
Diffstat (limited to 'src/runtime/cgo.go')
-rw-r--r-- | src/runtime/cgo.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/runtime/cgo.go b/src/runtime/cgo.go new file mode 100644 index 000000000..7e6b253af --- /dev/null +++ b/src/runtime/cgo.go @@ -0,0 +1,23 @@ +// Copyright 2014 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 runtime + +import "unsafe" + +//go:cgo_export_static main + +// Filled in by runtime/cgo when linked into binary. + +//go:linkname _cgo_init _cgo_init +//go:linkname _cgo_malloc _cgo_malloc +//go:linkname _cgo_free _cgo_free +//go:linkname _cgo_thread_start _cgo_thread_start + +var ( + _cgo_init unsafe.Pointer + _cgo_malloc unsafe.Pointer + _cgo_free unsafe.Pointer + _cgo_thread_start unsafe.Pointer +) |