root/common/trunk/src/memory.h @ 185

Revision 185, 2.6 KB (checked in by ucacoxh, 15 years ago)

add xmemdist(FILE *fp) which dumps the distribution of all currently
xmalloc'ed blocks to fp. Might help isolate the memory issue reported
by monsieur duros. not doing a very well replicating problem here and
mbone access and connectivity are screwed for external feeds.
multicast is dead, long live multicast.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * FILE:    memory.h
3 * PROGRAM: RAT
4 * AUTHOR:  Isidor Kouvelas + Colin Perkins + Orion Hodson
5 *
6 * $Revision$
7 * $Date$
8 *
9 * Copyright (c) 1995-98 University College London
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, is permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 *    notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 *    notice, this list of conditions and the following disclaimer in the
19 *    documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 *    must display the following acknowledgement:
22 *      This product includes software developed by the Computer Science
23 *      Department at University College London
24 * 4. Neither the name of the University nor of the Department may be used
25 *    to endorse or promote products derived from this software without
26 *    specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 */
39
40#ifndef _RAT_MEMORY_H
41#define _RAT_MEMORY_H
42
43#define xrealloc(p,x)   _xrealloc(p, x,__FILE__,__LINE__)
44#define xmalloc(x)      _xmalloc(x,__FILE__,__LINE__)
45#define xstrdup(x)      _xstrdup(x,__FILE__,__LINE__)
46
47/* Debug Functions */
48void     xdoneinit(void);
49void     xmemchk(void);
50void     xmemdmp(void);
51void     xclaim(void *p, const char *filen, int line);
52void     xmemdist(FILE *fp);
53
54/* Replacements for regular memory fn's */
55void     xfree(void *x);
56void    *_xmalloc(unsigned size,const char *filen,int line);
57void    *_xrealloc(void *p,unsigned size,const char *filen,int line);
58char    *_xstrdup(const char *s1, const char *filen, int line);
59void    *_block_alloc(unsigned size, const char *filen, int line);
60void     _block_free(void *p, int size, int line);
61
62#endif 
Note: See TracBrowser for help on using the browser.