mirror of
https://github.com/golang/go
synced 2024-11-20 00:24:43 -07:00
0b08c9483f
This CL makes the runtime understand that the type of the len or cap of a map, slice, or string is 'int', not 'int32', and it is also careful to distinguish between function arguments and results of type 'int' vs type 'int32'. In the runtime, the new typedefs 'intgo' and 'uintgo' refer to Go int and uint. The C types int and uint continue to be unavailable (cause intentional compile errors). This CL does not change the meaning of int, but it should make the eventual change of the meaning of int on amd64 a bit smoother. Update #2188. R=iant, r, dave, remyoudompheng CC=golang-dev https://golang.org/cl/6551067
15 lines
322 B
Plaintext
15 lines
322 B
Plaintext
// 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 runtime
|
|
#include "runtime.h"
|
|
|
|
func GOMAXPROCS(n int) (ret int) {
|
|
ret = runtime·gomaxprocsfunc(n);
|
|
}
|
|
|
|
func NumCPU() (ret int) {
|
|
ret = runtime·ncpu;
|
|
}
|