diff options
Diffstat (limited to 'src/rps/gnunet-service-rps_sampler.c')
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index 01d8aa748..419110440 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c | |||
@@ -417,8 +417,8 @@ RPS_sampler_get_size () | |||
417 | * | 417 | * |
418 | * @param new_size the new size of the sampler | 418 | * @param new_size the new size of the sampler |
419 | */ | 419 | */ |
420 | void | 420 | static void |
421 | RPS_sampler_resize (unsigned int new_size) | 421 | sampler_resize (unsigned int new_size) |
422 | { | 422 | { |
423 | unsigned int old_size; | 423 | unsigned int old_size; |
424 | uint32_t i; | 424 | uint32_t i; |
@@ -481,6 +481,31 @@ RPS_sampler_resize (unsigned int new_size) | |||
481 | 481 | ||
482 | 482 | ||
483 | /** | 483 | /** |
484 | * Grow or shrink the size of the sampler. | ||
485 | * | ||
486 | * @param new_size the new size of the sampler | ||
487 | */ | ||
488 | void | ||
489 | RPS_sampler_resize (unsigned int new_size) | ||
490 | { | ||
491 | GNUNET_assert (0 < new_size); | ||
492 | sampler_resize (new_size); | ||
493 | } | ||
494 | |||
495 | |||
496 | /** | ||
497 | * Empty the sampler. | ||
498 | * | ||
499 | * @param new_size the new size of the sampler | ||
500 | */ | ||
501 | void | ||
502 | RPS_sampler_empty () | ||
503 | { | ||
504 | sampler_resize (0); | ||
505 | } | ||
506 | |||
507 | |||
508 | /** | ||
484 | * Initialise a tuple of sampler elements. | 509 | * Initialise a tuple of sampler elements. |
485 | * | 510 | * |
486 | * @param init_size the size the sampler is initialised with | 511 | * @param init_size the size the sampler is initialised with |