Created
December 13, 2022 14:54
-
-
Save BruceChen7/ed3d143feac103f3d3bf2e36f0f244c4 to your computer and use it in GitHub Desktop.
#golang#pointer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (p *page) meta() *meta { | |
return (*meta)(unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))) | |
} | |
func unsafeAdd(base unsafe.Pointer, offset uintptr) unsafe.Pointer { | |
return unsafe.Pointer(uintptr(base) + offset) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment