Malloc Challenge
vicsydev.blogspot.com
Malloc Challenge
1–10 of 109 posts
Re: Malloc Challenge
#2Re: Malloc Challenge
#3Back when I worked in a C/C++ shop we'd use this as an in-person interview question for senior positions. The candidate was never expected to finish but more as a springboard to talk about the pro/cons and issues they'd seen with performance/etc of various approaches.
Re: Malloc Challenge
#4Looks like fun. Wish I had time to join in :(
Re: Malloc Challenge
#5Awesome challenge. Back when I worked in a C/C++ shop we'd use this as an in-person interview question for senior positions. The candidate was never expected to finish but more as a springboard to talk about the pro/cons and issues they'd seen with performance/etc of various approaches.
Re: Malloc Challenge
#6this is definitely one of the best projects i ever did in school and a great coming of age project. worst case, there's always an implementation at the back of K&R ;)
Re: Malloc Challenge
#7It's fairly easy to beat the given examples but in the end heap management is heavily dependent on application, client code, platform, hardware and many other criteria. It's a very complex problem space and what matters here is how existing important code behaves and continues to behave given that existing code has most likely made assumptions how the heap is managed.
glibc is a good example of a perfectly fine compromise not optimized for any particular use case. Anyone who has had performance issues with it has most likely already implemented their own solution for their problem set.
It might much more worthwhile to develop a set of malloc like implementations a developer can chose from instead of going for a fits all approach.
Re: Malloc Challenge
#8Re: Malloc Challenge
#9Re: Malloc Challenge
#10Awesome challenge. Back when I worked in a C/C++ shop we'd use this as an in-person interview question for senior positions. The candidate was never expected to finish but more as a springboard to talk about the pro/cons and issues they'd seen with performance/etc of various approaches.
Good call, writing C/C++ without having a grip on memory allocation is a recipe for exactly the kind of disaster we're in right now :)