You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by dr...@apache.org on 2001/07/02 10:32:30 UTC
cvs commit: apr/memory/unix apr_sms.c sms_private.h
dreid 01/07/02 01:32:29
Modified: include apr_sms.h
memory/unix apr_sms.c sms_private.h
Log:
More debugging and a small cleanup...
- change back some bits I removed in error
- add the start of an ability to "tag" an sms so we have more
information when debugging
Revision Changes Path
1.22 +19 -2 apr/include/apr_sms.h
Index: apr_sms.h
===================================================================
RCS file: /home/cvs/apr/include/apr_sms.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- apr_sms.h 2001/07/02 08:12:55 1.21
+++ apr_sms.h 2001/07/02 08:32:24 1.22
@@ -82,9 +82,12 @@
#define APR_CHILD_CLEANUP 0x0001
#define APR_PARENT_CLEANUP 0x0002
-/* Alignment macro's */
+/* Alignment macro's
+ *
+ * APR_ALIGN is only to be used to align on a power of 2 boundary
+ */
#define APR_ALIGN(size, boundary) \
- ((size) + (((boundary) - ((size) & ((boundary) - 1))) & ((boundary) - 1)))
+ (((size) + ((boundary) - 1)) & ~ ((boundary) -1))
#define APR_ALIGN_DEFAULT(size) APR_ALIGN(size, 8)
@@ -118,6 +121,12 @@
*/
/* #define DEBUG_SHOW_FUNCTIONS 1 */
+/* DEBUG_TAG_SMS
+ * Turn on the ability to give an SMS a "tag" that can be used to identify
+ * it.
+ */
+/* #define DEBUG_TAG_SMS 1 */
+
/**
* @package APR memory system
*/
@@ -344,6 +353,14 @@
APR_DECLARE(void) apr_sms_show_structure(apr_sms_t *sms, int direction);
#endif /* DEBUG_SHOW_STRUCTURE */
+#if DEBUG_TAG_SMS
+/**
+ * Set the debugging tag for an sms
+ * @param tag The tag to give the sms
+ * @param sms The sms to apply the tag to
+ */
+APR_DECLARE(void) apr_sms_tag(const char*tag, apr_sms_t *sms);
+#endif
#ifdef __cplusplus
}
1.31 +6 -0 apr/memory/unix/apr_sms.c
Index: apr_sms.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- apr_sms.c 2001/07/02 08:12:59 1.30
+++ apr_sms.c 2001/07/02 08:32:27 1.31
@@ -869,4 +869,10 @@
}
#endif /* DEBUG_SHOW_STRUCTURE */
+#if DEBUG_TAG_SMS
+APR_DECLARE(void) apr_sms_tag(const char *tag, apr_sms_t *sms)
+{
+ sms->tag = tag;
+}
+#endif
1.2 +4 -0 apr/memory/unix/sms_private.h
Index: sms_private.h
===================================================================
RCS file: /home/cvs/apr/memory/unix/sms_private.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sms_private.h 2001/07/02 08:13:03 1.1
+++ sms_private.h 2001/07/02 08:32:27 1.2
@@ -91,6 +91,10 @@
apr_status_t (*destroy_fn) (apr_sms_t *sms);
apr_status_t (*lock_fn) (apr_sms_t *sms);
apr_status_t (*unlock_fn) (apr_sms_t *sms);
+
+#if DEBUG_TAG_SMS
+ const char *tag;
+#endif
};
/*