好好爱自己!

上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 179 下一页
摘要: 1、使用mmap需要注意的一个关键点是,mmap映射区域大小必须是物理页大小(page_size)的整倍数(32位系统中通常是4k字节)。原因是,内存的最小粒度是页,而进程虚拟地址空间和内存的映射也是以页为单位。为了匹配内存的操作,mmap从磁盘到虚拟地址空间的映射也必须是页。 再啰嗦几句: lin 阅读全文
posted @ 2021-04-26 10:43 立志做一个好的程序员 阅读(2974) 评论(0) 推荐(0)
摘要: 15 2 Is there anyway to create null terminated string in Go? What I'm currently trying is a:="golang\0" but it is showing compilation error: non-octal 阅读全文
posted @ 2021-04-25 18:10 立志做一个好的程序员 阅读(126) 评论(0) 推荐(0)
摘要: 原文: https://studygolang.com/articles/2271 package main import ( "fmt" "strings" "log" ) func main() { reader := strings.NewReader("Go语言学习园地") reader.S 阅读全文
posted @ 2021-04-22 17:39 立志做一个好的程序员 阅读(4080) 评论(0) 推荐(0)
摘要: 原文:https://blog.csdn.net/cywosp/article/details/8767327 结合 https://github.com/boltdb/bolt.git boltdb源码看,就能发现它里面就用了fdatasync函数,来确保修改确实成功写入了磁盘。 传统的UNIX实 阅读全文
posted @ 2021-04-22 15:36 立志做一个好的程序员 阅读(217) 评论(0) 推荐(0)
摘要: 问题: I'm not sure what I'm missing but I get a deadlock error. I'm using a buffered channel that I range over after all go routines complete. The chann 阅读全文
posted @ 2021-04-21 15:44 立志做一个好的程序员 阅读(108) 评论(0) 推荐(0)
摘要: 原文:https://www.oldboyedu.com/zuixin_wenzhang/index/id/486.html package main import ( "sync" "log" ) func main() { var wg sync.WaitGroup for i := 0; i 阅读全文
posted @ 2021-04-21 13:53 立志做一个好的程序员 阅读(381) 评论(0) 推荐(0)
摘要: 原文:https://medium.com/@kdnotes/sort-sort-interface-in-golang-1d263d96956d package main import ( "fmt" "sort" //"unicode/utf8" ) type P struct { name s 阅读全文
posted @ 2021-04-20 17:26 立志做一个好的程序员 阅读(228) 评论(0) 推荐(0)
摘要: 转, 原文:https://www.jianshu.com/p/29ac532e7c96 type SizeOfE struct { A byte // 1 C byte // 1 B int64 // 8 } 内存分布图: package main import ( "log" "unsafe" 阅读全文
posted @ 2021-04-19 13:48 立志做一个好的程序员 阅读(251) 评论(0) 推荐(0)
摘要: 原文: https://blog.csdn.net/yzf279533105/article/details/97143100 package main import ( "fmt" "unsafe" "log" ) type Person struct { name string age int 阅读全文
posted @ 2021-04-19 13:24 立志做一个好的程序员 阅读(179) 评论(0) 推荐(0)
摘要: Alignof返回的对齐数是结构体中最大元素所占的内存数,不超过8, 参考:https://studygolang.com/articles/21827 unsafe.Sizeof 和 unsafe.Offsetof 的理解 package main import ( "fmt" "unsafe" 阅读全文
posted @ 2021-04-16 15:49 立志做一个好的程序员 阅读(862) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 179 下一页

不断学习创作,与自己快乐相处