grow_buckets Subroutine

private subroutine grow_buckets(this)

Double the bucket table and rehash. Entry storage is never moved.

Arguments

Type IntentOptional Attributes Name
class(hash_map_t), intent(inout) :: this

Calls

proc~~grow_buckets~~CallsGraph proc~grow_buckets grow_buckets proc~rebuild_buckets rebuild_buckets proc~grow_buckets->proc~rebuild_buckets proc~entry_key entry_key proc~rebuild_buckets->proc~entry_key proc~probe_free probe_free proc~rebuild_buckets->proc~probe_free proc~home_bucket home_bucket proc~probe_free->proc~home_bucket interface~fnv_1a_hash fnv_1a_hash proc~home_bucket->interface~fnv_1a_hash

Called by

proc~~grow_buckets~~CalledByGraph proc~grow_buckets grow_buckets proc~hash_map_insert hash_map_t%hash_map_insert proc~hash_map_insert->proc~grow_buckets

Variables

Type Visibility Attributes Name Initial
integer(kind=default_int), private, allocatable :: fresh(:)

Source Code

   subroutine grow_buckets(this)
      !! Double the bucket table and rehash. Entry storage is never moved.
      class(hash_map_t), intent(inout) :: this

      integer(default_int), allocatable :: fresh(:)

      allocate (fresh(this%n_buckets*2))
      deallocate (this%buckets)
      call move_alloc(fresh, this%buckets)
      this%n_buckets = this%n_buckets*2
      call rebuild_buckets(this)
   end subroutine grow_buckets