#include <stdio.h>
#include <stdlib.h>
+#ifdef CRYPTO_MDEBUG_TIME
+# include <time.h>
+#endif
#include <openssl/buffer.h>
#include <openssl/bio.h>
#include <openssl/lhash.h>
const char *file;
int line;
unsigned long order;
+#ifdef CRYPTO_MDEBUG_TIME
+ time_t time;
+#endif
} MEM;
int CRYPTO_mem_ctrl(int mode)
m->order=order;
}
m->order=order++;
+#ifdef CRYPTO_MDEBUG_TIME
+ m->time=time(NULL);
+#endif
if ((mm=(MEM *)lh_insert(mh,(char *)m)) != NULL)
{
/* Not good, but don't sweat it */
if(m->addr == (char *)l->bio)
return;
+#ifdef CRYPTO_MDEBUG_TIME
+ {
+ struct tm *lcl = localtime(&m->time);
+ sprintf(buf,"[%02d:%02d:%02d] %5lu file=%s, line=%d, number=%d, address=%08lX\n",
+ lcl->tm_hour,lcl->tm_min,lcl->tm_sec,
+ m->order,m->file,m->line,m->num,(unsigned long)m->addr);
+ }
+#else
sprintf(buf,"%5lu file=%s, line=%d, number=%d, address=%08lX\n",
m->order,m->file,m->line,m->num,(unsigned long)m->addr);
+#endif
BIO_puts(l->bio,buf);
l->chunks++;
l->bytes+=m->num;