Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2012, 03:45 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

C++ is not a garbage collected language. (1) If memory is allocated and deallocated the allocator can do what it wishes with the free memory. It is not required to, and in many cases will not, reduce the size of the heap as far as any monitoring tools can see and this does not mean there is a leak. The only guarantee is that all memory, allocated or free, will be released to the operating system when the program terminates.

The safe_delete macros aren't all that exciting. They check for a non-null pointer when it's perfectly safe to delete a null pointer, and setting the pointer to null afterward is only useful if the pointer is going to be reused and the code that reuses it actually examines the pointer before allocating the new memory. RAII and smart pointer are a much safer way to manage dynamic memory.

1. Memory allocator replacements that function as a garbage collector are available, but the emulator doesn't use them. I've been programming a long time and I've never seen them used.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:51 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3