fragment_lookup_destroy Subroutine

private pure subroutine fragment_lookup_destroy(this)

Clean up hash table and all chains

Type Bound

fragment_lookup_t

Arguments

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

Called by

proc~~fragment_lookup_destroy~~CalledByGraph proc~fragment_lookup_destroy fragment_lookup_t%fragment_lookup_destroy proc~compute_mbe compute_mbe proc~compute_mbe->proc~fragment_lookup_destroy proc~global_coordinator global_coordinator proc~global_coordinator->proc~compute_mbe proc~serial_fragment_processor serial_fragment_processor proc~serial_fragment_processor->proc~compute_mbe interface~global_coordinator global_coordinator interface~global_coordinator->proc~global_coordinator interface~serial_fragment_processor serial_fragment_processor interface~serial_fragment_processor->proc~serial_fragment_processor proc~mbe_run_distributed mbe_context_t%mbe_run_distributed proc~mbe_run_distributed->interface~global_coordinator proc~mbe_run_serial mbe_context_t%mbe_run_serial proc~mbe_run_serial->interface~serial_fragment_processor

Variables

Type Visibility Attributes Name Initial
type(hash_entry_t), private, pointer :: entry
integer, private :: i
type(hash_entry_t), private, pointer :: next_entry

Source Code

   pure subroutine fragment_lookup_destroy(this)
      !! Clean up hash table and all chains
      class(fragment_lookup_t), intent(inout) :: this
      integer :: i
      type(hash_entry_t), pointer :: entry, next_entry

      if (.not. this%initialized) return

      do i = 1, this%table_size
         ! Free chain
         entry => this%table(i)%next
         do while (associated(entry))
            next_entry => entry%next
            if (allocated(entry%key)) deallocate (entry%key)
            deallocate (entry)
            entry => next_entry
         end do
         ! Free bucket head
         if (allocated(this%table(i)%key)) deallocate (this%table(i)%key)
      end do

      deallocate (this%table)
      this%initialized = .false.
   end subroutine fragment_lookup_destroy