33

gopl 底层编程(unsafe包)-来玩魔王的咚!

 4 years ago
source link: https://blog.51cto.com/steed/2399853
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
unsafe包:Sizeof、Alignof和Offsetof,结构体内存对齐;unsafe.Pointer:查看浮点类型的位模式,修改结构体成员的值,不要把uintptr类型赋值给临时变量,reflect包返回的uintptr;深度相等示例:DeepEqual的不足,函数实现,支持循环引用,测试验证;注意事项

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK