提交 4f386723 authored 作者: Mathieu Rene's avatar Mathieu Rene

update object support header file


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk/contrib@15784 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a68e0da3
...@@ -40,7 +40,8 @@ public: ...@@ -40,7 +40,8 @@ public:
void unlock() void unlock()
{ {
switch_mutex_unlock(m_mutex); } switch_mutex_unlock(m_mutex);
}
class scoped_lock class scoped_lock
{ {
...@@ -153,6 +154,17 @@ public: ...@@ -153,6 +154,17 @@ public:
} }
} }
MemoryPool(switch_core_session_t *session)
{
if (session) {
m_owned = false;
m_pool = switch_core_session_get_pool(session);
} else {
m_owned = true;
switch_core_new_memory_pool(&m_pool);
}
}
MemoryPool() MemoryPool()
{ {
switch_core_new_memory_pool(&m_pool); switch_core_new_memory_pool(&m_pool);
...@@ -180,6 +192,19 @@ public: ...@@ -180,6 +192,19 @@ public:
{ {
return switch_core_strdup(m_pool, s); return switch_core_strdup(m_pool, s);
} }
char *sprintf(const char *fmt, ...)
{
va_list ap;
char *result = NULL;
va_start(ap, fmt);
result = switch_core_vsprintf(m_pool, fmt, ap);
va_end(ap);
return result;
}
}; };
#endif /* OBJECT_SUPPORT_H */ #endif /* OBJECT_SUPPORT_H */
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论