#include "curl_memory.h"
#include "memdebug.h"
+#ifndef HAVE_ASSERT_H
+# define assert(x) do { } while (0)
+#endif
+
struct memdebug {
size_t size;
union {
struct memdebug *mem;
size_t size;
+ assert(wantedsize != 0);
+
if(countcheck("malloc", line, source))
return NULL;
struct memdebug *mem;
size_t size, user_size;
+ assert(wanted_elements != 0);
+ assert(wanted_size != 0);
+
if(countcheck("calloc", line, source))
return NULL;
char *mem;
size_t len;
- DEBUGASSERT(str != NULL);
+ assert(str != NULL);
if(countcheck("strdup", line, source))
return NULL;
{
struct memdebug *mem=NULL;
+ assert(wantedsize != 0);
+
size_t size = sizeof(struct memdebug)+wantedsize;
if(countcheck("realloc", line, source))
{
struct memdebug *mem;
- DEBUGASSERT(ptr != NULL);
+ assert(ptr != NULL);
mem = (struct memdebug *)((char *)ptr - offsetof(struct memdebug, mem));
{
int res;
- DEBUGASSERT(file != NULL);
+ assert(file != NULL);
res=fclose(file);
if(logfile)