mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
weak: move internal/weak to weak, and update according to proposal
The updates are: - API documentation changes. - Removal of the old package documentation discouraging linkname. - Addition of new package documentation with some advice. - Renaming of weak.Pointer.Strong -> weak.Pointer.Value. Fixes #67552. Change-Id: Ifad7e629b6d339dacaf2ca37b459d7f903e31bf8 Reviewed-on: https://go-review.googlesource.com/c/go/+/628455 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
5e82cba9bd
commit
a65f1a467f
15 changed files with 129 additions and 110 deletions
|
|
@ -2092,12 +2092,12 @@ type specialWeakHandle struct {
|
|||
handle *atomic.Uintptr
|
||||
}
|
||||
|
||||
//go:linkname internal_weak_runtime_registerWeakPointer internal/weak.runtime_registerWeakPointer
|
||||
//go:linkname internal_weak_runtime_registerWeakPointer weak.runtime_registerWeakPointer
|
||||
func internal_weak_runtime_registerWeakPointer(p unsafe.Pointer) unsafe.Pointer {
|
||||
return unsafe.Pointer(getOrAddWeakHandle(unsafe.Pointer(p)))
|
||||
}
|
||||
|
||||
//go:linkname internal_weak_runtime_makeStrongFromWeak internal/weak.runtime_makeStrongFromWeak
|
||||
//go:linkname internal_weak_runtime_makeStrongFromWeak weak.runtime_makeStrongFromWeak
|
||||
func internal_weak_runtime_makeStrongFromWeak(u unsafe.Pointer) unsafe.Pointer {
|
||||
handle := (*atomic.Uintptr)(u)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue