Index: trunk/psLib/swig/pslib.i
===================================================================
--- trunk/psLib/swig/pslib.i	(revision 3124)
+++ trunk/psLib/swig/pslib.i	(revision 3145)
@@ -5,5 +5,17 @@
 #define SWIG
 #include "pslib.h"
+
+/* SWIG uses malloc/free - make it use the pslib memory functions instead. */
+/* 
+#define malloc(S)    psAlloc(S)
+#define realloc(P,S) psRealloc(P,S)
+#define free(P)      psFree(P)
+*/
+
 %}
+
+/* grab the typedefs used throughout psLib, e.g. psU8, psU16,... */
+%import "psType.h"
+%import "psMemory.h"
 
 %include "cpointer.i"
