Index: /trunk/psLib/src/sys/psMemory.c
===================================================================
--- /trunk/psLib/src/sys/psMemory.c	(revision 23304)
+++ /trunk/psLib/src/sys/psMemory.c	(revision 23305)
@@ -1069,2 +1069,17 @@
                    memBlock->func, memBlock->file, memBlock->lineno, (unsigned long)memBlock->tid);
 }
+
+bool psMemTypeEqual (void *ptr1, void *ptr2) {
+
+    // if ptr is a psAlloc()'d memory, find the actual address of the memBlock
+    psMemBlock *memBlock1 = ((psMemBlock *)ptr1) - 1;
+    HANDLE_BAD_BLOCK(memBlock1, __FILE__, __LINE__, __func__);
+    if (!memBlock1->freeFunc) return false;
+
+    // if ptr is a psAlloc()'d memory, find the actual address of the memBlock
+    psMemBlock *memBlock2 = ((psMemBlock *)ptr2) - 1;
+    HANDLE_BAD_BLOCK(memBlock2, __FILE__, __LINE__, __func__);
+    if (!memBlock2->freeFunc) return false;
+
+    return (memBlock1->freeFunc == memBlock2->freeFunc);
+}
Index: /trunk/psLib/src/sys/psMemory.h
===================================================================
--- /trunk/psLib/src/sys/psMemory.h	(revision 23304)
+++ /trunk/psLib/src/sys/psMemory.h	(revision 23305)
@@ -636,4 +636,14 @@
 );
 
+/** test for matching types (equal free functions)
+ *
+ * This function returns true if the two pointers have matching, non-NULL free functions.
+ * Supplied pointers must have been allocated within the psLib memory system (ie, with a psAlloc) or the function will abort. (XXX just return false?)
+ * Supplied pointers must have been provided with free function or the function returns false.
+ */
+bool psMemTypeEqual (void *ptr1, ///< pointer to first psMemory object
+		     void *ptr2 ///< pointer to second psMemory object
+  );
+
 // Ensure this is a psLib pointer
 #define PS_ASSERT_PTR_HEAVY(PTR, RVAL) \
