Skip to content

Commit

Permalink
lib-stats: Add stats_reset function
Browse files Browse the repository at this point in the history
  • Loading branch information
Aki Tuomi authored and sirainen committed Jan 15, 2016
1 parent 7d4c804 commit 75b12af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib-stats/stats.c
Expand Up @@ -218,3 +218,8 @@ void *stats_fill_ptr(struct stats *stats, struct stats_item *item)
{
return PTR_OFFSET(stats, item->pos);
}

void stats_reset(struct stats *stats)
{
memset(stats, 0, stats_total_size);
}
2 changes: 2 additions & 0 deletions src/lib-stats/stats.h
Expand Up @@ -66,4 +66,6 @@ bool stats_import(const unsigned char *data, size_t size,
alloc_size() number of bytes). */
void *stats_fill_ptr(struct stats *stats, struct stats_item *item);

void stats_reset(struct stats *stats);

#endif

0 comments on commit 75b12af

Please sign in to comment.