diff options
author | frsyuki <frsyuki@5a5092ae-2292-43ba-b2d5-dcab9c1a2731> | 2009-02-15 09:09:58 +0000 |
---|---|---|
committer | frsyuki <frsyuki@5a5092ae-2292-43ba-b2d5-dcab9c1a2731> | 2009-02-15 09:09:58 +0000 |
commit | 31659738110f7d73d8fd4fe2d6fc62991ac7912f (patch) | |
tree | 3296e710cb71a4414fa04e406878a943aa37c292 /cpp/zone.hpp | |
parent | a7936ba05b15ec7a19e8dc75667fec2df13b7ea7 (diff) | |
download | msgpack-python-31659738110f7d73d8fd4fe2d6fc62991ac7912f.tar.gz |
lang/c/msgpack: fix compile optimization flag
git-svn-id: file:///Users/frsyuki/project/msgpack-git/svn/x@70 5a5092ae-2292-43ba-b2d5-dcab9c1a2731
Diffstat (limited to 'cpp/zone.hpp')
-rw-r--r-- | cpp/zone.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/zone.hpp b/cpp/zone.hpp index f8c9cba..e7e73e1 100644 --- a/cpp/zone.hpp +++ b/cpp/zone.hpp @@ -41,10 +41,17 @@ 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); |