You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the problem with #2230, but this allocation is so performance-impairing that it consumes hundreds of nanoseconds more, it's almost pointless, and the "index" is the same as the incoming "i", which can be deleted entirely. If you are worried about compatibility, you can also provide a new method without deleting the old one (this may cause new history issues, but compatibility will be better). The problem with this method is that packages seeking high performance have to use the "unsafe" and "namelink" methods instead of directly using "toType" and "toRtype", which may also lead to an additional risk of memory leaks, which are dangerous and destabilizing (this may be similar to the "reflect.SliceHeader" problem).
The text was updated successfully, but these errors were encountered:
Note: the issue reference in the top comment should be to #2320.
We can't change the definition of StructField; that would break existing programs and the Go compatibility guarantee. We aren't going to introduce a new variant of StructField that duplicates the existing definition.
Use assembler to make runtime.staticuint64s into a readonly array
so that the reflect package can safely create a slice without requiring
any allocation.
Fixes#2320Fixes#68380
Change-Id: If2c97238eca782d0632db265c840581d4ecb9d18
Reviewed-on: https://go-review.googlesource.com/c/go/+/597855
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Proposal Details
I noticed the problem with #2230, but this allocation is so performance-impairing that it consumes hundreds of nanoseconds more, it's almost pointless, and the "index" is the same as the incoming "i", which can be deleted entirely. If you are worried about compatibility, you can also provide a new method without deleting the old one (this may cause new history issues, but compatibility will be better). The problem with this method is that packages seeking high performance have to use the "unsafe" and "namelink" methods instead of directly using "toType" and "toRtype", which may also lead to an additional risk of memory leaks, which are dangerous and destabilizing (this may be similar to the "reflect.SliceHeader" problem).
The text was updated successfully, but these errors were encountered: