ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/memory.h
(Generate patch)

Comparing:
ircd-hybrid/include/memory.h (file contents), Revision 33 by knight, Sun Oct 2 20:50:00 2005 UTC vs.
ircd-hybrid-7.2/include/memory.h (file contents), Revision 1010 by michael, Thu Sep 17 17:06:11 2009 UTC

# Line 26 | Line 26
26   #define _I_MEMORY_H
27  
28   #include "ircd_defs.h"
29 < #include "setup.h"
29 > #include "config.h"
30   #include "balloc.h"
31  
32 /* Needed to use uintptr_t for some pointer manipulation. */
33
34 #ifdef HAVE_INTTYPES_H
35 # include <inttypes.h>
36 #else /* No inttypes.h */
37 # ifndef HAVE_UINTPTR_T
38 typedef unsigned long uintptr_t;
39 # endif
40 #endif
41
32   extern void outofmemory(void);
33  
34 < extern void *MyMalloc(size_t size);
35 < extern void *MyRealloc(void *x, size_t y);
36 < extern void MyFree(void *x);
37 < extern void _DupString(char **x, const char *y);
48 <
49 < /* forte (and maybe others) don't like double declarations,
50 < * so we don't declare the inlines unless GNUC
51 < */
52 < #ifdef __GNUC__
53 < extern inline void *
54 < MyMalloc(size_t size)
55 < {
56 <  void *ret = calloc(1, size);
57 <
58 <  if (ret == NULL)
59 <    outofmemory();
60 <  return(ret);
61 < }
62 <
63 < extern inline void *
64 < MyRealloc(void *x, size_t y)
65 < {
66 <  void *ret = realloc(x, y);
67 <
68 <  if (ret == NULL)
69 <    outofmemory();
70 <  return(ret);    
71 < }
72 <
73 < extern inline void
74 < MyFree(void *x)
75 < {
76 <  if (x != NULL)
77 <    free(x);
78 < }
79 <
80 < extern inline void
81 < _DupString(char **x, const char *y)
82 < {
83 <  (*x) = malloc(strlen(y) + 1);
84 <
85 <  if (x == NULL)
86 <    outofmemory();
87 <  strcpy((*x), y);
88 < }
89 < #endif /* __GNUC__ */
34 > extern void *MyMalloc(size_t);
35 > extern void *MyRealloc(void *, size_t);
36 > extern void MyFree(void *);
37 > extern void _DupString(char **, const char *);
38  
39   #define DupString(x,y) _DupString(&x, y)
40   #endif /* _I_MEMORY_H */

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)