]> andersk Git - moira.git/blobdiff - server/mr_main.c
mucked with host table authorization checks...
[moira.git] / server / mr_main.c
index f9f539bd36223219484ba47aadf193d5c9408b5a..704a57a7afb73da85acb5dba6d4d2258db26e83e 100644 (file)
@@ -46,8 +46,6 @@ extern char *takedown;
 extern int errno;
 extern FILE *journal;
 
-extern char *malloc();
-extern int free();
 extern char *inet_ntoa();
 extern void mr_com_err();
 extern void do_client();
@@ -59,6 +57,11 @@ void reapchild(), godormant(), gowakeup();
 
 extern time_t now;
 
+#ifdef _DEBUG_MALLOC_INC
+static char *dbg_malloc();
+static int dbg_free();
+#endif
+
 /*
  * Main MOIRA server loop.
  *
@@ -107,8 +110,13 @@ main(argc, argv)
        /* Profiling implies that getting rid of one level of call
         * indirection here wins us maybe 1% on the VAX.
         */
+#ifdef _DEBUG_MALLOC_INC
+       gdb_amv = dbg_malloc;
+       gdb_fmv = dbg_free;
+#else
        gdb_amv = malloc;
-       gdb_fmv = free;
+       gdb_fmv = (int (*)()) free;
+#endif
        
        /*
         * GDB initialization.
@@ -552,3 +560,19 @@ mr_setup_signals()
        exit(1);
     }
 }
+
+#ifdef _DEBUG_MALLOC_INC
+static char *dbg_malloc(size)
+       SIZETYPE        size;
+{
+       return( debug_malloc("somewhere in the gdb code",1,size) );
+}
+
+static int dbg_free(cptr)
+       DATATYPE        *cptr;
+{
+       debug_free((char *)NULL, 0, cptr);
+       return 0;               /* GDB is being stupid */
+}
+#endif
+
This page took 0.033153 seconds and 4 git commands to generate.