Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another attempt to reduce size_of<HashMap> #159

Merged
merged 11 commits into from
May 23, 2020
Merged

Another attempt to reduce size_of<HashMap> #159

merged 11 commits into from
May 23, 2020

Commits on May 17, 2020

  1. Reduce size_of<HashMap>

    - `data` field is removed, instead the allocation layout is changed such that first element of control bytes start exactly at one past last element of data table. So we just use negative index to access data table without touching size field.
    - Rewritten `calculate_layout` to remove padding between two tables, its placed either at start or end of allocation if necessary.
    iwa0 authored May 17, 2020
    Configuration menu
    Copy the full SHA
    cdca6fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2fa183b View commit details
    Browse the repository at this point in the history
  3. add #[allow(dead_code)] to compute_data_ptr()

    fix build failure
    iwa0 authored May 17, 2020
    Configuration menu
    Copy the full SHA
    850093a View commit details
    Browse the repository at this point in the history
  4. fix miri and clippy build errors

    doing `ptr as usize as *mut _` does escape from miri analysis
    ```
    ptr: NonNull::new_unchecked(ptr),
         |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a potentially NULL pointer, but expected something that cannot possibly fail to be greater or equal to 1
    ```
    I am not sure if this is correct way to fix it.
    iwa0 authored May 17, 2020
    Configuration menu
    Copy the full SHA
    9a5fffc View commit details
    Browse the repository at this point in the history

Commits on May 20, 2020

  1. Update mod.rs

    - Removed unnecessary padding at the end of `calculate_layout`
    - Put back old comments
    - Renamed some functions
    - Use `#[cfg(feature = "...")]` instead `#[allow(dead_code)]`
    iwa0 authored May 20, 2020
    Configuration menu
    Copy the full SHA
    8002c2c View commit details
    Browse the repository at this point in the history

Commits on May 21, 2020

  1. see description

    - nightly version of calculate_layout was putting padding between two tables in some cases, fixed. Also added debug_assert! to check this.
    - use wrapping_sub() instead sub() in data_start() (empty RawTable returns buckets() == 1, crosses allocation bounds)
    iwa0 authored May 21, 2020
    Configuration menu
    Copy the full SHA
    a58cdf4 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2020

  1. Configuration menu
    Copy the full SHA
    46328d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    47c10e7 View commit details
    Browse the repository at this point in the history
  3. Update mod.rs

    - Removed unnecessary code from nightly `calculate_layout`
    - Added comment for `Bucket::ptr` data member
    iwa0 authored May 22, 2020
    Configuration menu
    Copy the full SHA
    7027781 View commit details
    Browse the repository at this point in the history
  4. fix old variable name

    iwa0 authored May 22, 2020
    Configuration menu
    Copy the full SHA
    5a59dd3 View commit details
    Browse the repository at this point in the history
  5. fix test failure

    removed wrong assertation code
    iwa0 authored May 22, 2020
    Configuration menu
    Copy the full SHA
    b500a0a View commit details
    Browse the repository at this point in the history