mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00: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:
parent
a7936ba05b
commit
3165973811
9 changed files with 80 additions and 43 deletions
16
cpp/zone.hpp
16
cpp/zone.hpp
|
|
@ -40,11 +40,18 @@ public:
|
|||
private:
|
||||
std::vector<char*> m_ptrs;
|
||||
|
||||
private:
|
||||
char* realloc_real(char* ptr, size_t count);
|
||||
|
||||
private:
|
||||
zone(const zone&);
|
||||
};
|
||||
|
||||
|
||||
inline zone::zone() { }
|
||||
|
||||
inline zone::~zone() { clear(); }
|
||||
|
||||
inline char* zone::malloc(size_t count)
|
||||
{
|
||||
char* ptr = (char*)::malloc(count);
|
||||
|
|
@ -58,6 +65,15 @@ inline char* zone::malloc(size_t count)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
inline char* zone::realloc(char* ptr, size_t count)
|
||||
{
|
||||
if(ptr == NULL) {
|
||||
return zone::malloc(count);
|
||||
} else {
|
||||
return realloc_real(ptr, count);
|
||||
}
|
||||
}
|
||||
|
||||
inline object* zone::malloc_container(size_t count)
|
||||
{
|
||||
return (object*)zone::malloc(sizeof(object)*count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue