c++ - Boost::Mutex & Malloc -


I am trying to use a fast memory allocation in C ++ due to licensing / cost, I could not use I was using NEDMalloc in the same threaded setting and received excellent performance, but I am thinking that I should switch to something else - as I understand things, NEDMalloc is just a C-based Molec () Is a replacement for; Free (), No C ++ - New & amp; Delete operators (which I use on a large scale).

The problem is that now I should be thread-safe, so I'm trying to malloc an object that is counted (to prevent additional transcript), but in which a mute pointer In this way, if you want to delete the previous copy, you have to first lock the pointer, then release the object, and finally unlock it & amp; Free Mutex.

However, the use of malloc to promote: The twists seem impossible because I can not start the personal object as the initial verboton to call the constructor directly.

So I have been left out of this strange situation, where I am using new to allocate new and all to allocate and allocate to nadmaulok. But when I allocate memory in large quantities, then I go into allocation errors (which disappears when I switch to malloc instead of the nodalock but the display is terrible). My guess is that it is due to the fragmentation in memory and the inability of nedmalloc and good place for the new side.

A better solution should be what you suggest?

Google is fairly fast, safe by default, and easy to use. Just link it to your application, because it will change behavior or malloc / open and new / delete . This ensures that new olococortals are actually speeding things up.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -