News for hackers. Stuff that matters.
Re:I disagree with Linus Torvalds about C++ (2009) by atilaneves on Monday December 24, 2018 @06:58AM (#18751753)
You can overload operator new to not use the heap. You can use allocators.
Re:I disagree with Linus Torvalds about C++ (2009) by heavenlyblue on Monday December 24, 2018 @07:00AM (#18751763)
Overloading new (for the purpose, of e.g. adding a thread-local allocator) adds implicit global state that isn't always easy to manage.
Re:I disagree with Linus Torvalds about C++ (2009) by gpderetta on Monday December 24, 2018 @08:47AM (#18752099)
Sure, but no more than the standard allocator. Explicit allocator objects are a superior solution most of the time anyway.
Re:I disagree with Linus Torvalds about C++ (2009) by martinlaz on Tuesday December 25, 2018 @03:21PM (#18759033)
Good memory management is never easy on a system level, so if one is overloading new, they'd better be comfortable around the complexities involved.
Re:I disagree with Linus Torvalds about C++ (2009) by altmind on Monday December 24, 2018 @10:58AM (#18752664)
if you decide to use new/new[], you are bound to use the same allocator everywhere. c++ did not give you a chance to customize your allocation.