Commit Graph

865 Commits

Author SHA1 Message Date
Masaaki Goshima d85327b458 Replace int/uint encoding implementation 2020-12-20 04:02:03 +09:00
Masaaki Goshima fdce754b17 Expand source for string encoding 2020-12-20 04:02:03 +09:00
Masaaki Goshima 01b439e41e Refactor buffering of encoder for improvement performance 2020-12-20 04:02:03 +09:00
Masaaki Goshima 920c79e0b7
Merge pull request #69 from goccy/feature/add-benchmark
Add github.com/segmentio/encoding/json to benchmark
2020-12-20 04:01:21 +09:00
Masaaki Goshima 7028c33e67 Add github.com/segmentio/encoding/json to benchmark 2020-12-20 03:57:24 +09:00
Masaaki Goshima 0e0bf702c1
Merge pull request #68 from goccy/feature/add-benchmark
Optimize access to opcodeMap
2020-12-15 14:55:13 +09:00
Masaaki Goshima 6eb02f7ac0 Optimize access to opcodeMap 2020-12-15 14:46:10 +09:00
Masaaki Goshima d88eb0986e Fix UnmarshalTypeError for int decoder 2020-12-15 12:29:19 +09:00
Masaaki Goshima 85577616f8 Support int and uint types as map key type 2020-12-12 18:09:46 +09:00
Masaaki Goshima 2e411ac3f6
Merge pull request #67 from zchee/const-uintptrSize
Change uintptrSize to constant
2020-12-09 19:57:29 +09:00
Koichi Shiraishi cdac126d80
Change uintptrSize to constant 2020-12-09 19:20:51 +09:00
Masaaki Goshima 699ab766f5 Fix read timing and test case 2020-12-07 11:40:03 +09:00
Masaaki Goshima 59f5713178 Fix double pointer 2020-12-07 10:49:00 +09:00
Masaaki Goshima ee52d7f0ae Fix double pointer 2020-12-07 10:44:24 +09:00
Masaaki Goshima 5a8383f0d2 Fix ptrIndex 2020-12-06 19:59:39 +09:00
Masaaki Goshima 4332d1353e Fix stream decoding 2020-12-05 22:27:33 +09:00
Masaaki Goshima 7f97aca5e6 Fix skipValue 2020-11-27 17:41:47 +09:00
Masaaki Goshima 7421d82c43 Fix syntax error 2020-11-27 17:11:53 +09:00
Masaaki Goshima 47b7f4a5a2 Fix decoding for UnmarshalJSON / UnmarshalText 2020-11-24 20:15:11 +09:00
Masaaki Goshima 5c82b00ee7 Add structName and fieldName argument to each constructor of decoder for UnmarshalTypeError 2020-11-23 17:16:31 +09:00
Masaaki Goshima 73ba04190f
Merge pull request #62 from zchee/fix-decode-checkptr
Fix checkptr validation error on decode
2020-11-23 14:51:05 +09:00
Koichi Shiraishi 2b4097577d
Pass expression to unsafe.Pointer directly 2020-11-23 14:13:45 +09:00
Koichi Shiraishi e4214835d8
Fix checkptr validation error on decode 2020-11-23 06:47:57 +09:00
Masaaki Goshima 07dda3c387 Fix unicode handling 2020-11-23 00:10:42 +09:00
Masaaki Goshima f8eb061538 Fix decoder 2020-11-22 02:47:18 +09:00
Masaaki Goshima eee16e83f5
Merge pull request #61 from goccy/feature/escape-pointer-for-decoder
Fix race data for decoder
2020-11-19 16:24:44 +09:00
Masaaki Goshima ce1f865330 Remove dummy field for keeping reference of pointer 2020-11-19 12:54:43 +09:00
Masaaki Goshima fd7a72c0b8 Pass unsafe.Pointer instead of uintptr 2020-11-19 12:47:42 +09:00
Masaaki Goshima 5ab988208f
Merge pull request #60 from goccy/feature/fix-unexpected-free-pointer
Fix a bugs where pointers are unexpectedly freed
2020-11-19 03:36:56 +09:00
Masaaki Goshima 18e2d87772 Fix env settings 2020-11-19 02:26:56 +09:00
Masaaki Goshima e319a33e70 Omit test with race detector 2020-11-19 02:21:04 +09:00
Masaaki Goshima df0b68da4d Fix test option 2020-11-19 02:16:05 +09:00
Masaaki Goshima 5701138d7d Update CI settings 2020-11-19 02:12:48 +09:00
Masaaki Goshima 35395bba60 Keep unsafe.Pointer reference for handling of opInterface 2020-11-18 17:05:27 +09:00
Masaaki Goshima 6a11c84d0c Fix test case 2020-11-18 16:47:50 +09:00
Masaaki Goshima 71f8fc352b
Merge pull request #59 from goccy/feature/refactor-ptr
Refactor cast manipulation from uintptr
2020-11-17 15:19:21 +09:00
Masaaki Goshima 9802f67a9b Refactor unsupported value error for float64 2020-11-17 15:14:07 +09:00
Masaaki Goshima ea96cc7811 Refactor cast manipulation from uintptr 2020-11-17 15:09:06 +09:00
Masaaki Goshima c79cf6a3f5 Refactor error of marshaler 2020-11-17 15:08:12 +09:00
Masaaki Goshima 69ea157270 Refactor unsupported value for float64 2020-11-17 15:06:05 +09:00
Masaaki Goshima e88d0248b5
Merge pull request #52 from zchee/ci-support-multiversion
Support multiple go version
2020-11-16 23:51:37 +09:00
Koichi Shiraishi fd28e427bc
github/workflows: test also race build 2020-11-16 23:48:26 +09:00
Koichi Shiraishi 4271f208db
github/workflows: add 1.14 and 1.15 2020-11-16 23:48:26 +09:00
Koichi Shiraishi 09cf542962
github/workflows: hook also pull_request 2020-11-16 23:48:26 +09:00
Koichi Shiraishi 02e7dbb187
github/workflows: upgrade setup-go to v2 2020-11-16 23:48:26 +09:00
Masaaki Goshima 600ebf03a8
Merge pull request #58 from zchee/fix-resolve-conflict
Fix resolve conflict to #55
2020-11-16 23:47:48 +09:00
Koichi Shiraishi 96528cbae4
Fix resolve conflict to #55 2020-11-16 23:39:33 +09:00
Masaaki Goshima bfa3640e2b
Merge pull request #55 from cuonglm/cuonglm/do-not-use-reflect-SliceHeader
Make "go test -gcflags=-d=checkptr" passes
2020-11-16 22:55:17 +09:00
Cuong Manh Le 6b1d701387
Fix all invalid usages of unsafe.Pointer
Most of the invalid usages due to the conversion from uintptr to
unsafe.Pointer. In general, unsafe.Pointer(p) where p of type uintptr is
considered unsafe.

To fix that, use &p instead of p, then introduce another dereference.
Example, the invalid usage:

	*(*int)(unsafe.Pointer(p)) = int(v)

wil become:

	**(**int)(unsafe.Pointer(&p)) = int(v)

Closes #53
2020-11-16 20:37:12 +07:00
Cuong Manh Le e58b1eabaf
Remove all usages of reflect.SliceHeader
There're some problem with current usage of reflect.SliceHeader.

First, it violates the unsafe pointer conversion (rule 6th), that said,
reflect.SliceHeader must not used as plain struct.

Second, the lowest version that go-json supports, go1.12, reflect
package did not use SliceHeader in typedslicecopy, but use the safety
version. There's no reason that go-json continue using them.

See:

 - https://golang.org/pkg/unsafe/#Pointer
 - https://github.com/golang/go/blob/release-branch.go1.12/src/reflect/value.go#L2702
2020-11-16 20:33:49 +07:00