LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "arch_GOARCH.h" | 6 #include "arch_GOARCH.h" |
7 #include "type.h" | 7 #include "type.h" |
8 #include "typekind.h" | 8 #include "typekind.h" |
9 #include "malloc.h" | 9 #include "malloc.h" |
10 | 10 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 size = t->size; | 177 size = t->size; |
178 alg = t->alg; | 178 alg = t->alg; |
179 | 179 |
180 if(size <= sizeof(*src)) | 180 if(size <= sizeof(*src)) |
181 alg->copy(size, dst, src); | 181 alg->copy(size, dst, src); |
182 else | 182 else |
183 alg->copy(size, dst, *src); | 183 alg->copy(size, dst, *src); |
184 } | 184 } |
185 | 185 |
| 186 #pragma textflag 7 |
| 187 void |
| 188 runtime·typ2Itab(Type *t, InterfaceType *inter, Itab **cache, Itab *ret) |
| 189 { |
| 190 Itab *tab; |
| 191 |
| 192 tab = itab(inter, t, 0); |
| 193 runtime·atomicstorep(cache, tab); |
| 194 ret = tab; |
| 195 FLUSH(&ret); |
| 196 } |
| 197 |
186 // func convT2I(typ *byte, typ2 *byte, cache **byte, elem any) (ret any) | 198 // func convT2I(typ *byte, typ2 *byte, cache **byte, elem any) (ret any) |
187 #pragma textflag 7 | 199 #pragma textflag 7 |
188 void | 200 void |
189 runtime·convT2I(Type *t, InterfaceType *inter, Itab **cache, ...) | 201 runtime·convT2I(Type *t, InterfaceType *inter, Itab **cache, ...) |
190 { | 202 { |
191 byte *elem; | 203 byte *elem; |
192 Iface *ret; | 204 Iface *ret; |
193 Itab *tab; | 205 Itab *tab; |
194 int32 wid; | 206 int32 wid; |
195 | 207 |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 // type structure sits before the data pointer. | 714 // type structure sits before the data pointer. |
703 t = (Type*)((Eface*)typ.data-1); | 715 t = (Type*)((Eface*)typ.data-1); |
704 | 716 |
705 size = n*t->size; | 717 size = n*t->size; |
706 if(t->kind&KindNoPointers) | 718 if(t->kind&KindNoPointers) |
707 ret = runtime·mallocgc(size, FlagNoPointers, 1, 1); | 719 ret = runtime·mallocgc(size, FlagNoPointers, 1, 1); |
708 else | 720 else |
709 ret = runtime·mal(size); | 721 ret = runtime·mal(size); |
710 FLUSH(&ret); | 722 FLUSH(&ret); |
711 } | 723 } |
LEFT | RIGHT |