Towards a Better Allocator Model

作者
Pablo Halpern
摘要

In drafting the 1998 ISO C++ language standard, the standards committee did not consider, or did not consider important, that the allocator type parameter used to instantiate a container template affects the container’s type, thereby making it incompatible with containers employing a different allocation policy, but which otherwise have identical type. In our work, we have found it desirable, and often necessary, to customize the memory allocation for our containers and strings on a per-instance basis, without affecting the compile-time type of those containers or strings. Proper control over memory also required that objects within a container share an allocator with the container itself. Using an existing implementation of the C++ standard library as a base, we made backward-compatible modifications to enable such per-instance allocators. Our experience is that, once implemented, these modifications allowed us to use allocators in a wide range of situations to facilitate testing, efficient memory utilization, and even the prevention of memory leaks. This paper describes our allocator model and proposes changes to the upcoming revision of the standard library based on our experience.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
1秒前
2秒前
czy发布了新的文献求助10
3秒前
共享精神应助超级绮波采纳,获得10
3秒前
Jie完成签到,获得积分10
4秒前
5秒前
li发布了新的文献求助10
6秒前
舒服的吐司完成签到 ,获得积分10
6秒前
7秒前
feng完成签到,获得积分10
7秒前
7秒前
华仔应助蓝火采纳,获得10
8秒前
8秒前
Furstar完成签到,获得积分10
8秒前
田様应助粗犷的翎采纳,获得30
8秒前
JamesPei应助Eunectes采纳,获得10
9秒前
水晶鞋完成签到 ,获得积分10
10秒前
10秒前
林林完成签到,获得积分10
10秒前
逮劳发布了新的文献求助10
11秒前
11秒前
XLB完成签到,获得积分20
11秒前
wanci应助czy采纳,获得10
12秒前
xwtx发布了新的文献求助10
12秒前
华仔应助li采纳,获得10
13秒前
lily发布了新的文献求助10
14秒前
顺利的海亦完成签到 ,获得积分10
14秒前
子不语发布了新的文献求助10
14秒前
16秒前
16秒前
313完成签到 ,获得积分10
16秒前
17秒前
vicky完成签到 ,获得积分10
20秒前
20秒前
ding应助超级绮波采纳,获得10
20秒前
大圆土豆发布了新的文献求助10
21秒前
懒祝xifeng发布了新的文献求助10
21秒前
zzz应助Excuseme采纳,获得10
22秒前
安静的猴子完成签到,获得积分10
22秒前
knp完成签到,获得积分10
22秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Principles of town planning: translating concepts to applications 1000
Management and the Arts 510
Matrix Methods in Data Mining and Pattern Recognition Second Edition 510
The Effective Clinical Neurologist 3ed 500
The Great Hymn to Šamaš 500
Positive Obsession: The Life and Times of Octavia E. Butler 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7698407
求助须知:如何正确求助?哪些是违规求助? 9258147
关于积分的说明 20012317
捐赠科研通 7273501
什么是DOI,文献DOI怎么找? 3293303
关于科研通互助平台的介绍 2448741
邀请新用户注册赠送积分活动 2299393