aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/slice.c
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-07-31 12:43:40 -0700
committerKeith Randall <khr@golang.org>2014-07-31 12:43:40 -0700
commitcc9ec52d739ec3c9f2a3e9bfdcc98643bee61cca (patch)
tree45b71559077a62fde3dd7bc477292538416da657 /src/pkg/runtime/slice.c
parent2c982ce9a0d30cf7c771d24b2d4d124b8230087a (diff)
downloadgo-cc9ec52d739ec3c9f2a3e9bfdcc98643bee61cca.tar.xz
runtime: convert slice operations to Go.
LGTM=bradfitz, dvyukov R=golang-codereviews, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/120190044
Diffstat (limited to 'src/pkg/runtime/slice.c')
-rw-r--r--src/pkg/runtime/slice.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/pkg/runtime/slice.c b/src/pkg/runtime/slice.c
new file mode 100644
index 0000000000..5483a2084d
--- /dev/null
+++ b/src/pkg/runtime/slice.c
@@ -0,0 +1,27 @@
+// 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.
+
+#include "runtime.h"
+#include "arch_GOARCH.h"
+
+void
+runtime·printslice_m(G *gp)
+{
+ void *array;
+ uintptr len, cap;
+
+ array = g->m->ptrarg[0];
+ g->m->ptrarg[0] = nil;
+ len = g->m->scalararg[0];
+ cap = g->m->scalararg[1];
+
+ runtime·prints("[");
+ runtime·printint(len);
+ runtime·prints("/");
+ runtime·printint(cap);
+ runtime·prints("]");
+ runtime·printpointer(array);
+
+ runtime·gogo(&gp->sched);
+}