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

Comparing ircd-hybrid-7.2/src/ircd.c (file contents):
Revision 896 by michael, Sat Nov 3 08:54:09 2007 UTC vs.
Revision 948 by michael, Tue Jul 21 17:34:06 2009 UTC

# Line 84 | Line 84 | struct ServerStatistics ServerStats;
84   struct timeval SystemTime;
85   struct Client me;             /* That's me */
86   struct LocalUser meLocalUser; /* That's also part of me */
87 unsigned long connect_id = 0; /* unique connect ID */
87  
88   static unsigned long initialVMTop = 0;   /* top of virtual memory at init */
89   const char *logFileName = LPATH;
# Line 123 | Line 122 | unsigned int split_servers;
122  
123   int rehashed_klines = 0;
124  
126 /*
127 * get_vm_top - get the operating systems notion of the resident set size
128 */
129 #ifndef _WIN32
130 static unsigned long
131 get_vm_top(void)
132 {
133  /*
134   * NOTE: sbrk is not part of the ANSI C library or the POSIX.1 standard
135   * however it seems that everyone defines it. Calling sbrk with a 0
136   * argument will return a pointer to the top of the process virtual
137   * memory without changing the process size, so this call should be
138   * reasonably safe (sbrk returns the new value for the top of memory).
139   * This code relies on the notion that the address returned will be an
140   * offset from 0 (NULL), so the result of sbrk is cast to a size_t and
141   * returned. We really shouldn't be using it here but...
142   */
143
144  void *vptr = sbrk(0);
145  return((unsigned long)vptr);
146 }
125  
126   /*
127   * print_startup - print startup information
# Line 177 | Line 155 | make_daemon(void)
155   }
156   #endif
157  
180 /*
181 * get_maxrss - get the operating systems notion of the resident set size
182 */
183 unsigned long
184 get_maxrss(void)
185 {
186 #ifdef _WIN32
187  return (0);   /* FIXME */
188 #else
189  return (get_vm_top() - initialVMTop);
190 #endif
191 }
192
158   static int printVersion = 0;
159  
160   struct lgetopt myopts[] = {
# Line 552 | Line 517 | main(int argc, char *argv[])
517  
518    /* Setup corefile size immediately after boot -kre */
519    setup_corefile();
555
556  /* set initialVMTop before we allocate any memory */
557  initialVMTop = get_vm_top();
520   #endif
521  
522    /* save server boot time right away, so getrusage works correctly */

Diff Legend

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