Added fixes for:

Compilers that pretend to be Visual C++
export of memory management code


[SVN r18955]
This commit is contained in:
John Maddock
2003-07-07 11:44:00 +00:00
parent 5c0a6398ab
commit c32c644a38
4 changed files with 55 additions and 7 deletions

View File

@ -31,6 +31,15 @@
# include <malloc.h>
#endif
#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3)
#if BOOST_REGEX_MAX_CACHE_BLOCKS == 0
#include <new>
#else
#include <boost/regex/v4/mem_block_cache.hpp>
#endif
#endif
namespace boost{
//
@ -104,8 +113,34 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_regex_exception(const std::string&
#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3)
#if BOOST_REGEX_MAX_CACHE_BLOCKS == 0
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block()
{
return ::operator new(BOOST_REGEX_BLOCKSIZE);
}
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p)
{
::operator delete(p);
}
#else
mem_block_cache block_cache = { 0, };
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block()
{
return block_cache.get();
}
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p)
{
block_cache.put(p);
}
#endif
#endif
} // namespace re_detail