Technical support > Bugs in stable version (2.5)

Build of 2.5-dev fails to initialize com_genericPool before use on Darwin/Clang

<< < (3/4) > >>

Nokim:

--- Quote from: Jon_dArc on June 22, 2012, 02:31:18 pm ---Are we sure the redefinitions are (ostensibly) purely an optimization?

--- End quote ---
Optimization and statistics. Speed up because of reuse of already allocated memory and some statistics on memory usage in different pools which represent different game subsystems. However more common way to do so is to replace malloc function, like using TCMalloc (which is added to app just by linker, no code editing if no profiling required). But in game engine in all parts is used our Mem_Alloc/Mem_Free, so there is no real need to redeclare new/delete if you not trying to speed up external code like STL in such way.

Jon_dArc:
It's not clear to me exactly what distinction I was trying to draw there. Maybe I'd just gotten confused.

My best candidate for a solution at the moment (other than removing the operator redefinitions) is to stick memory pool initialization, at least for com_genericPool, into a function with a constructor attribute to force initialization before main. As a solution it makes me feel a little unhappy, but I've confirmed that it works on ufomodel at least.

~J

Jon_dArc:
Repeating a question from IRC in case no one ends up seeing it there:

Do we know that there are clear benefits to the redefinitions? Benchmarks showing clear performance improvements, or additional known-valuable information about allocations, or somesuch? I'm considering digging into Nokim's issue, but I want to make sure that they're actually worth salvaging before putting in the effort.

~J

Mattn:
the clear benefit will be visible once we use sharedptr and scopedptr implementations. then we can just use new/delete but in the back we are still using our pools.

Jon_dArc:
Ok, so it's groundwork for using the pools transparently in the future. Time to install that VM, then!

~J

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version