News for hackers. Stuff that matters.
Re:Hidden Costs of Memory Allocation by pjc50 on Wednesday December 10, 2014 @09:17AM (#8729216)
Because what you've written doesn't make much sense? You can't pass a type as a function parameter to a user defined function, and if you mean the builtin "new" (no capital) then that uses the normal allocator.
Re:Hidden Costs of Memory Allocation by fla on Wednesday December 10, 2014 @10:40AM (#8729696)
I think he meant that MyType is an enum and New is a user-defined function with a huge switch that does allocate (with placement new?) the correct type based on the value of MyType. Yea works, but introduces runtime overhead and is the gate to maintenance hell.
Re:Hidden Costs of Memory Allocation by cdevfr on Wednesday December 10, 2014 @10:21AM (#8729575)
It is basic OOP in C. Look it up.