mirror of
https://github.com/msgpack/msgpack-c.git
synced 2026-01-12 10:02:38 +01:00
lang/c/msgpack: fix compile optimization flag
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@70 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
This commit is contained in:
26
cpp/zone.cpp
26
cpp/zone.cpp
@@ -20,10 +20,6 @@
|
||||
namespace msgpack {
|
||||
|
||||
|
||||
zone::zone() { }
|
||||
|
||||
zone::~zone() { clear(); }
|
||||
|
||||
void zone::clear()
|
||||
{
|
||||
for(std::vector<char*>::iterator it(m_ptrs.begin()), it_end(m_ptrs.end());
|
||||
@@ -33,22 +29,18 @@ void zone::clear()
|
||||
m_ptrs.clear();
|
||||
}
|
||||
|
||||
char* zone::realloc(char* ptr, size_t count)
|
||||
char* zone::realloc_real(char* ptr, size_t count)
|
||||
{
|
||||
if(ptr == NULL) {
|
||||
return zone::malloc(count);
|
||||
} else {
|
||||
for(std::vector<char*>::reverse_iterator it(m_ptrs.rbegin()), it_end(m_ptrs.rend());
|
||||
it != it_end; ++it) {
|
||||
if(*it == ptr) {
|
||||
char* tmp = (char*)::realloc(ptr, count);
|
||||
if(!tmp) { throw std::bad_alloc(); }
|
||||
*it = tmp;
|
||||
return tmp;
|
||||
}
|
||||
for(std::vector<char*>::reverse_iterator it(m_ptrs.rbegin()), it_end(m_ptrs.rend());
|
||||
it != it_end; ++it) {
|
||||
if(*it == ptr) {
|
||||
char* tmp = (char*)::realloc(ptr, count);
|
||||
if(!tmp) { throw std::bad_alloc(); }
|
||||
*it = tmp;
|
||||
return tmp;
|
||||
}
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user