rbb 01/01/01 17:19:08
Modified: . CHANGES
include apr_general.h
Log:
Add an APR_GET_POOL macro to get a pool from any APR type that has
a pool. This requires that ALL apr types put the pool as the first
field in their structure.
Revision Changes Path
1.34 +4 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- CHANGES 2000/12/31 18:04:59 1.33
+++ CHANGES 2001/01/02 01:19:07 1.34
@@ -1,5 +1,9 @@
Changes with APR b1
+ *) Add an APR_GET_POOL macro to get a pool from any APR type that has
+ a pool. This requires that ALL apr types put the pool as the first
+ field in their structure. [Ryan Bloom]
+
*) Begin to remove the ability to allocate out of NULL pools. The first
problem to solve, is that we need an apr_lock in order to allocate
pools, so that we can lock things out when allocating. So, how do we
1.47 +11 -0 apr/include/apr_general.h
Index: apr_general.h
===================================================================
RCS file: /home/cvs/apr/include/apr_general.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- apr_general.h 2000/12/04 05:44:52 1.46
+++ apr_general.h 2001/01/02 01:19:07 1.47
@@ -210,6 +210,17 @@
#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
#endif
+/* This is a general apr type that should only ever be used in the
APR_GET_POOL
+ * macro. This is basically used to let us get the pool from any apr type
+ * that has one.
+ */
+struct apr_t {
+ apr_pool_t *pool;
+};
+
+#define APR_GET_POOL(foo) \
+ ((struct apr_t *)foo)->pool
+
/* A couple of prototypes for functions in case some platform doesn't
* have it
*/