You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/10/06 18:11:23 UTC
svn commit: r1005098 - in
/subversion/branches/object-model/subversion/bindings/c++/include: Pool.h
Types.h
Author: hwright
Date: Wed Oct 6 16:11:23 2010
New Revision: 1005098
URL: http://svn.apache.org/viewvc?rev=1005098&view=rev
Log:
On the object-model branch:
Add another Pool helper function to allocate a single item of a given type.
* subversion/bindings/c++/include/Pool.h
(alloc): New overloaded version of this template function.
* subversion/bindings/c++/include/Types.h
(Version::dup): Use the new function.
Modified:
subversion/branches/object-model/subversion/bindings/c++/include/Pool.h
subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Modified: subversion/branches/object-model/subversion/bindings/c++/include/Pool.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Pool.h?rev=1005098&r1=1005097&r2=1005098&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Pool.h (original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Pool.h Wed Oct 6 16:11:23 2010
@@ -60,6 +60,13 @@ namespace SVN
return reinterpret_cast<T *>(apr_palloc(m_pool, sz));
}
+ template <typename T>
+ inline T *
+ alloc()
+ {
+ return alloc<T>(sizeof(T));
+ }
+
inline char *
strdup(const char *str)
{
Modified: subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=1005098&r1=1005097&r2=1005098&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (original)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Wed Oct 6 16:11:23 2010
@@ -265,7 +265,7 @@ class Version
inline static svn_version_t *
dup(const svn_version_t *version, Pool &pool)
{
- svn_version_t *v = pool.alloc<svn_version_t>(sizeof(*v));
+ svn_version_t *v = pool.alloc<svn_version_t>();
v->major = version->major;
v->minor = version->minor;