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

Comparing ircd-hybrid/trunk/src/whowas.c (file contents):
Revision 1997 by michael, Sat May 11 17:35:07 2013 UTC vs.
Revision 2297 by michael, Wed Jun 19 11:57:38 2013 UTC

# Line 119 | Line 119 | get_history(const char *nick, time_t tim
119   }
120  
121   void
122 < count_whowas_memory(unsigned int *wwu, uint64_t *wwum)
122 > whowas_count_memory(unsigned int *const count, uint64_t *const bytes)
123   {
124 <  const struct Whowas *tmp;
125 <  int i;
126 <  unsigned int u = 0;
127 <  uint64_t um = 0;
124 >  const struct Whowas *tmp = &WHOWAS[0];
125 >  unsigned int i = 0;
126  
127 <  /* count the number of used whowas structs in 'u'   */
130 <  /* count up the memory used of whowas structs in um */
131 <  for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; ++i, ++tmp)
127 >  for (; i < NICKNAMEHISTORYLENGTH; ++i, ++tmp)
128    {
129      if (tmp->hashv != -1)
130      {
131 <      ++u;
132 <      um += sizeof(struct Whowas);
131 >      (*count)++;
132 >      (*bytes) += sizeof(struct Whowas);
133      }
134    }
139
140  *wwu = u;
141  *wwum = um;
135   }

Diff Legend

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