Repository navigation
Commit 81c7d03
Cap deserialized
1024 ought to be enough for anybody. And probably few people are serializing caches or weak-entry-based maps, anyway. And people should be using [Caffeine](https://github.com/ben-manes/caffeine).
There was already a cap of 64k, so these collections didn't permit arbitrary-sized allocations. Still, the reduction brings them more in line with what is already possible when deserializing built-in JDK types. See, for example, [`LogRecord`](https://github.com/openjdk/jdk/blob/4e8bec6f862b58732537dea15cb3dd50a01fede0/src/java.logging/share/classes/java/util/logging/LogRecord.java#L704) and [`ZoneRules`](https://github.com/openjdk/jdk/blob/4e8bec6f862b58732537dea15cb3dd50a01fede0/src/java.base/share/classes/java/time/zone/ZoneRules.java#L464) (though the constant factors are still different).
(If any user of the classes is directly passing a concurrency level of more than 1024, it's extremely likely that that user would be better off if we were to cap it to 1024 in that code path, too. But I'm not bothering in this CL.)
RELNOTES=n/a
PiperOrigin-RevId: 993749847LocalCache+MapMakerInternalMap concurrency level at 1024.1 parent 51246d0 commit 81c7d03
8 files changed
Lines changed: 40 additions & 4 deletions
File tree
- android
- guava-tests/test/com/google/common
- cache
- collect
- guava/src/com/google/common
- cache
- collect
- guava-tests/test/com/google/common
- cache
- collect
- guava/src/com/google/common
- cache
- collect
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2722 | 2722 | | |
2723 | 2723 | | |
2724 | 2724 | | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
2725 | 2734 | | |
2726 | 2735 | | |
2727 | 2736 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
966 | 967 | | |
967 | 968 | | |
968 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
969 | 978 | | |
970 | 979 | | |
971 | 980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4559 | 4559 | | |
4560 | 4560 | | |
4561 | 4561 | | |
4562 | | - | |
| 4562 | + | |
4563 | 4563 | | |
4564 | 4564 | | |
4565 | 4565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2852 | 2852 | | |
2853 | 2853 | | |
2854 | 2854 | | |
2855 | | - | |
| 2855 | + | |
2856 | 2856 | | |
2857 | 2857 | | |
2858 | 2858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2768 | 2768 | | |
2769 | 2769 | | |
2770 | 2770 | | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
2771 | 2780 | | |
2772 | 2781 | | |
2773 | 2782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
966 | 967 | | |
967 | 968 | | |
968 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
969 | 978 | | |
970 | 979 | | |
971 | 980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4732 | 4732 | | |
4733 | 4733 | | |
4734 | 4734 | | |
4735 | | - | |
| 4735 | + | |
4736 | 4736 | | |
4737 | 4737 | | |
4738 | 4738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2852 | 2852 | | |
2853 | 2853 | | |
2854 | 2854 | | |
2855 | | - | |
| 2855 | + | |
2856 | 2856 | | |
2857 | 2857 | | |
2858 | 2858 | | |
| |||
0 commit comments