开发者

Extension wrapper malloc allocator for C++ STL

开发者 https://www.devze.com 2022-12-19 23:00 出处:网络
Apparently there is a “malloc_allocator” provided with gcc f开发者_StackOverflowor use with STL. It simply wraps malloc and free. There is also a hook for an out-of-memory handler. Where can I find

Apparently there is a “malloc_allocator” provided with gcc f开发者_StackOverflowor use with STL. It simply wraps malloc and free. There is also a hook for an out-of-memory handler. Where can I find more about it? Where can I find its header file? I’m using gcc 4.x.


Is this something you want? You will need to include and pass in an object as the STL object's allocator template parameter.


The out-of-memory handler in c++ is defined via set_new_handler, which might be in the <new> header, but I'm not sure.

0

精彩评论

暂无评论...
验证码 换一张
取 消