p****s 发帖数: 32405 | 1 有没有个例子可以看一看? 我是指用的数据结构和算法, 想看个
稍微简单的implementation的例子.
顺便抽象地问一下, memory pool的机制跟malloc相比, 它的优劣在哪? | t****t 发帖数: 6806 | 2 for introduction document, Effective C++ has a brief one (if you happen to
have the book).
for (not necessary simple) example, Boost has a Pool library. EC++ 2nd
version has a simplified example too, but Meyers took it away in 3rd version
, with the reason "they usually omit such pesky details as portability and
alignment consideration, thread safety, etc."
【在 p****s 的大作中提到】 : 有没有个例子可以看一看? 我是指用的数据结构和算法, 想看个 : 稍微简单的implementation的例子. : 顺便抽象地问一下, memory pool的机制跟malloc相比, 它的优劣在哪?
| m***t 发帖数: 254 | 3 i have sample code for thread pool, i have sample code for malloc, but no
sample code for memory pool.
what is a memory pool? what is the difference between memory pool and malloc
implementation in KRC?
【在 p****s 的大作中提到】 : 有没有个例子可以看一看? 我是指用的数据结构和算法, 想看个 : 稍微简单的implementation的例子. : 顺便抽象地问一下, memory pool的机制跟malloc相比, 它的优劣在哪?
| p****s 发帖数: 32405 | 4 我正在看thrust推荐的effective c++里关于内存池的那一章.
大概上, 和malloc/free比内存池的机制更多是用于embedded system, 因为其资源有限.
具体的我还在看. 不过implementation是一定要overload new和delete这两个C标准符的.
【在 m***t 的大作中提到】 : i have sample code for thread pool, i have sample code for malloc, but no : sample code for memory pool. : what is a memory pool? what is the difference between memory pool and malloc : implementation in KRC?
| a****l 发帖数: 8211 | 5 it's not about resource limitation...
限.
符的.
【在 p****s 的大作中提到】 : 我正在看thrust推荐的effective c++里关于内存池的那一章. : 大概上, 和malloc/free比内存池的机制更多是用于embedded system, 因为其资源有限. : 具体的我还在看. 不过implementation是一定要overload new和delete这两个C标准符的.
| t****t 发帖数: 6806 | 6 usually it's about speed, not about limited resource.
however if you can avoid fragment and fine-control the allocation, it can
also about limited resource.:)
【在 a****l 的大作中提到】 : it's not about resource limitation... : : 限. : 符的.
|
|