소스 검색

codec: on 32-bit OS, using atomic functions requires 64-bit alignment

Updates #232
Ugorji Nwoke 7 년 전
부모
커밋
0076dd9cb1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      codec/helper_unsafe.go

+ 1 - 1
codec/helper_unsafe.go

@@ -176,8 +176,8 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) b
 // --------------------------
 
 type atomicTypeInfoSlice struct { // expected to be 2 words
+	l int64          // length of the data array (must be first in struct, for 64-bit alignment necessary for 386)
 	v unsafe.Pointer // data array - Pointer (not uintptr) to maintain GC reference
-	l int64          // length of the data array
 }
 
 func (x *atomicTypeInfoSlice) load() []rtid2ti {