Rev 2927 | Rev 4348 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2927 | Rev 3153 | ||
---|---|---|---|
Line 61... | Line 61... | ||
61 | 61 | ||
62 | h->entry = (link_t *) malloc(m * sizeof(link_t), 0); |
62 | h->entry = (link_t *) malloc(m * sizeof(link_t), 0); |
63 | if (!h->entry) { |
63 | if (!h->entry) { |
64 | panic("cannot allocate memory for hash table\n"); |
64 | panic("cannot allocate memory for hash table\n"); |
65 | } |
65 | } |
66 | memsetb((uintptr_t) h->entry, m * sizeof(link_t), 0); |
66 | memsetb(h->entry, m * sizeof(link_t), 0); |
67 | 67 | ||
68 | for (i = 0; i < m; i++) |
68 | for (i = 0; i < m; i++) |
69 | list_initialize(&h->entry[i]); |
69 | list_initialize(&h->entry[i]); |
70 | 70 | ||
71 | h->entries = m; |
71 | h->entries = m; |