CS318 - Pintos
Pintos source browser for JHU CS318 course
Data Fields
hash_elem Struct Reference

Hash table. More...

#include <hash.h>

Collaboration diagram for hash_elem:
Collaboration graph
[legend]

Data Fields

struct list_elem list_elem
 

Detailed Description

Hash table.

This data structure is thoroughly documented in the Tour of Pintos for Project 3.

This is a standard hash table with chaining. To locate an element in the table, we compute a hash function over the element's data and use that as an index into an array of doubly linked lists, then linearly search the list.

The chain lists do not use dynamic allocation. Instead, each structure that can potentially be in a hash must embed a struct hash_elem member. All of the hash functions operate on these `struct hash_elem's. The hash_entry macro allows conversion from a struct hash_elem back to a structure object that contains it. This is the same technique used in the linked list implementation. Refer to lib/kernel/list.h for a detailed explanation. Hash element.

Definition at line 29 of file hash.h.

Field Documentation

◆ list_elem

struct list_elem hash_elem::list_elem

Definition at line 31 of file hash.h.

Referenced by hash_next(), insert_elem(), and remove_elem().


The documentation for this struct was generated from the following file: