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 |
|
} |