Skip to content

Creating cuckoo hash map with capacity <= 0.5*SLOT_PER_BUCKET causes bad_alloc exception #2

Closed

Description

@jinliangwei

I admit creating such a small hash map is kind of uncommon.

The problem is in reserve_calc(). When capacity is too small,

log2((double)n / (double)SLOT_PER_BUCKET)

gives you a negative number and subsequently new_hashpower is really large.

Activity

  1. added a commit that references this issue on Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions