mem:Go的内存分配器

时间:2021-03-15 18:25:15
【文件属性】:
文件名称:mem:Go的内存分配器
文件大小:6KB
文件格式:ZIP
更新时间:2021-03-15 18:25:15
Go 记忆 包内存实现内存分配器和释放器。 当前,它使用unix上的mmap和Windows上的VirtualAlloc来向操作系统请求内存页面,并使用munmap和VirtualFree来向操作系统释放内存页面。 分配器在块的单链接*列表上使用首选算法。 块分为称为arenas的集合,它们对应于从操作系统映射的内存块。 释放集合中的所有块时,将不映射竞技场。 // Alloc allocates size bytes of memory, and returns a pointer to it. // It is goroutine-safe and attempts to preserve the semantics of // POSIX libc's malloc. However, Alloc panics if an error occurs when // requestin
【文件预览】:
mem-master
----.travis.yml(120B)
----mem.go(4KB)
----mem_test.go(3KB)
----map_unix.go(596B)
----map_windows.go(401B)
----LICENSE.md(640B)
----.gitignore(199B)
----go.sum(207B)
----README.md(2KB)
----go.mod(103B)

网友评论