Feature #23

Add ZeroedMemoryAllocator class to automatically initialize memory of objects

Added by tdev over 2 years ago. Updated 9 months ago.

Status:Assigned Start date:12/14/2009
Priority:Normal Due date:
Assignee:tdev % Done:

10%

Category:RoR - General
Target version:0.39

Description

Add ZeroedMemoryAllocator class to automatically initialize memory of objects. This removes the need for explicit initialization of memory of data structures, which either get forgotten or gradually increase code size.

The attached patch includes the code as used in OpenTTD, with minor tweaks for compilation in RoR's codebase; NORETURN is removed, byte has been changed to unsigned char, and Ogre's LogManager is used.

A brief test of this patch does work for me, however as it fundamentally changes the allocation method of the class it's used in, this patch will require thorough testing. It may also be worth using the allocator class on other classes within RoR.

commit-921c18d.diff (12.6 kB) Magnifier tdev, 02/01/2010 03:16 pm

History

#1 Updated by tdev over 2 years ago

nice addition, please test everyone :)

#2 Updated by tdev over 2 years ago

  • File deleted (commit-921c18d.diff)

#3 Updated by tdev over 2 years ago

#4 Updated by tdev about 2 years ago

  • Category set to RoR - General
  • Target version set to 0.37

#5 Updated by tdev almost 2 years ago

  • Assignee set to Aperion

aperion: opinion?

#6 Updated by tdev almost 2 years ago

  • Target version deleted (0.37)

#7 Updated by tdev about 1 year ago

  • Status changed from New to Assigned
  • Assignee changed from Aperion to tdev
  • Target version set to 0.38
  • % Done changed from 0 to 10

i'm wondering if this is a hit on performance

#8 Updated by tdev 12 months ago

  • Target version changed from 0.38 to 0.39

Also available in: Atom PDF