Index: trunk/ppImage/src/ppImage.c
===================================================================
--- trunk/ppImage/src/ppImage.c	(revision 6114)
+++ trunk/ppImage/src/ppImage.c	(revision 6148)
@@ -1,6 +1,41 @@
 #include "ppImage.h"
+
+psMemId ppMemAlloc(const psMemBlock *ptr)
+{
+    psLogMsg(__func__, PS_LOG_INFO,
+             "Allocated memory block %d: %ld references\n"
+             "\tFile %s, line %d, size %d\n"
+             "\tPosts: %lx %lx %lx\n"
+             "\tLast operation: %s:%d\n",
+             ptr->id, ptr->refCounter, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock,
+             ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize),
+             ptr->lastopFile, ptr->lastopLine);
+    return 0;
+}
+
+psMemId ppMemFree(const psMemBlock *ptr)
+{
+    psLogMsg(__func__, PS_LOG_INFO,
+             "Freed memory block %d: %ld references\n"
+             "\tFile %s, line %d, size %d\n"
+             "\tPosts: %lx %lx %lx\n"
+             "\tLast operation: %s:%d\n",
+             ptr->id, ptr->refCounter-1, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock,
+             ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize),
+             ptr->lastopFile, ptr->lastopLine);
+    return 0;
+}
+
 
 int main(int argc, char **argv)
 {
+#if 0
+    psMemAllocCallbackSet(ppMemAlloc);
+    psMemFreeCallbackSet(ppMemFree);
+//    psMemAllocCallbackSetID(6967);
+//    psMemFreeCallbackSetID(6967);
+    psMemAllocCallbackSetID(51804);
+    psMemFreeCallbackSetID(51804);
+#endif
 
     ppData data;
