mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-11 02:00:48 +02:00
msgpack_zone_clear, msgpack::zone::clear
This commit is contained in:
@@ -64,6 +64,9 @@ public:
|
||||
// otherwise the memrory will leak.
|
||||
zone* release_zone();
|
||||
|
||||
/*! 5.2. this method is equivalence to `delete release_zone()` */
|
||||
void reset_zone();
|
||||
|
||||
/*! 5.3. after release_zone(), re-initialize unpacker */
|
||||
void reset();
|
||||
|
||||
@@ -217,6 +220,11 @@ inline zone* unpacker::release_zone()
|
||||
return r;
|
||||
}
|
||||
|
||||
inline void unpacker::reset_zone()
|
||||
{
|
||||
msgpack_unpacker_reset_zone(this);
|
||||
}
|
||||
|
||||
inline void unpacker::reset()
|
||||
{
|
||||
msgpack_unpacker_reset(this);
|
||||
|
@@ -37,6 +37,8 @@ public:
|
||||
|
||||
void push_finalizer(void (*func)(void*), void* data);
|
||||
|
||||
void clear();
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename T<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
T* allocate(<%=(1..i).map{|j|"A#{j} a#{j}"}.join(', ')%>);
|
||||
@@ -78,6 +80,11 @@ inline void zone::push_finalizer(void (*func)(void*), void* data)
|
||||
}
|
||||
}
|
||||
|
||||
inline void zone::clear()
|
||||
{
|
||||
msgpack_zone_clear(this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void zone::object_destructor(void* obj)
|
||||
{
|
||||
|
Reference in New Issue
Block a user