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

[🍒] Unconditionally lower std::string's alignment requirement from 16 to 8 (#68925) #79480

Merged
merged 1 commit into from
Feb 7, 2024

Commits on Jan 25, 2024

  1. Unconditionally lower std::string's alignment requirement from 16 to …

    …8. (llvm#68925)
    
    Unconditionally change std::string's alignment to 8.
    
    This change saves memory by providing the allocator more freedom to
    allocate the most
    efficient size class by dropping the alignment requirements for
    std::string's
    pointer from 16 to 8. This changes the output of std::string::max_size,
    which makes it ABI breaking.
    
    That said, the discussion concluded that we don't care about this ABI
    break. and would like this change enabled universally.
    
    The ABI break isn't one of layout or "class size", but rather the value
    of "max_size()" changes, which in turn changes whether `std::bad_alloc`
    or `std::length_error` is thrown for large allocations.
    
    This change is the child of PR llvm#68807, which enabled the change behind
    an ABI flag.
    EricWF committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    81e2424 View commit details
    Browse the repository at this point in the history