8000 Comparing 2cff5cc...e89d44f · unicode-org/icu · GitHub
[go: up one dir, main page]

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: unicode-org/icu
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2cff5cc
Choose a base ref
...
head repository: unicode-org/icu
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e89d44f
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Jun 6, 2025

  1. ICU-20392 Split the Locale payload into nested and heap allocated.

    All the most commonly used Locale objects have very little payload, most
    of them don't use any extensions, don't use a language tag longer than 3
    characters and don't use more than a single variant.
    
    There's room for all that data in a simple 32 byte large payload object,
    which can be nested directly in the Locale object.
    
    Any payload larger than that can instead be heap allocated as needed, in
    order to save storage for the most commonly used objects while retaining
    the ability to create arbitrarily large and complex Locale objects.
    
    This reduces the storage requirements for all Locale objects.
    
    For nested payloads, this reduction is from 224 bytes to 48 bytes.
    
    For payloads that need to be heap allocated, the reduction depends on
    several factors, but for most cases there's some reduction. There are
    also cases where this refactoring actually increases the storage used,
    because CharString allocates more storage than necessary. There are a
    number of ways in which this could be improved upon, such as optimizing
    CharString to not allocate more than necessary when copying a string of
    known length, not allocating any empty CharString objects or possibly
    replacing CharString with a new class for fixed length strings.
    
    The public API remains unchanged but the operations which can lead to
    U_MEMORY_ALLOCATION_ERROR change.
    roubert committed Jun 6, 2025
    Configuration menu
    Copy the full SHA
    e89d44f View commit details
    Browse the repository at this point in the history
Loading
0