Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » What is the difference between the memory management in C and C++?
Re: What is the difference between the memory management in C and C++? [message #34963 is a reply to message #34716] Wed, 21 December 2011 14:57 Go to previous messageGo to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
The *only* advantage using malloc is realloc() to reallocate blocks, which in many cases is by far more efficient than creating a new block and copying data on it.

BTW, realloc usage makes sense only on low level coding and with POD types, which is not the case of most c++ code.
Anyways, I think that a missing 'renew' is a bad thing for c++ and makes porting of old code painful sometimes.

Just last thing : mixing new + realloc and free or malloc and delete is an error which can bring *many* problems if you use a toolkit with custom allocators, as UPP.


Max
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: UDP Server/Client with Winsock
Next Topic: prototype not found
Goto Forum:
  


Current Time: Sun Apr 28 23:43:50 CEST 2024

Total time taken to generate the page: 0.92915 seconds