Skip to content

GH-115776: Embed the values array into the object, for "normal" Python objects. #116115

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

Merged
merged 35 commits into from
Apr 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d5085db
Inline values work in progress
markshannon Feb 3, 2024
0d88de4
Change layout of PyDictValue to make is suitable for appending to end…
markshannon Feb 4, 2024
d922903
Add copy_values function
markshannon Feb 21, 2024
c03e6cb
Tidy up _PyObject_Init
markshannon Feb 21, 2024
621ea3b
Inline values -- Work in progress
markshannon Feb 21, 2024
67daab5
Get inline values closer to working
markshannon Feb 23, 2024
34c7171
Further fixing
markshannon Feb 23, 2024
c237e79
Remove debug field
markshannon Feb 23, 2024
f80befa
Remove unused function
markshannon Feb 23, 2024
a0c11e4
Merge branch 'main' into inline-values
markshannon Feb 24, 2024
bc1ebc8
Two tweaks
markshannon Feb 24, 2024
0dc68a4
Rename dict-or-values to managed-dict
markshannon Feb 24, 2024
084519c
Update object layout doc
markshannon Feb 24, 2024
3744f32
Add news
markshannon Feb 24, 2024
75ee5a0
Fix a couple of compilation errors on Windows
markshannon Feb 24, 2024
162764c
Update gdb support
markshannon Feb 24, 2024
82ece1b
Specialize LOAD_ATTR for (uninitialized) managed dicts
markshannon Feb 24, 2024
6a762ed
Allow extra allocation in JIT for tests.
markshannon Feb 24, 2024
9dbc8dd
Fix error from merge
markshannon Feb 24, 2024
4a1f7b7
Fix another mis-merge and update generated files
markshannon Feb 24, 2024
09121f9
Fix formatting
markshannon Feb 24, 2024
c384b05
Fix up free threading
markshannon Feb 24, 2024
ee5cf2a
Merge branch 'main' into inline-values
markshannon Feb 24, 2024
005b42b
Remove incorrect assertion
markshannon Feb 24, 2024
48d849e
Merge branch 'main' into inline-values
markshannon Feb 24, 2024
682217c
Remove some debug code
markshannon Feb 24, 2024
0ff1709
Fix off by one error.
markshannon Feb 24, 2024
895a944
Simplify PyObject_ClearManagedDict
markshannon Feb 25, 2024
1b4302a
Merge branch 'main' into inline-values
markshannon Mar 5, 2024
ecd4204
Merge branch 'main' into inline-values
markshannon Mar 26, 2024
c05d01d
Get tests passing for free-threaded build
markshannon Mar 26, 2024
d441d7b
Review comment and compiler warnings
markshannon Mar 27, 2024
3395bc2
Update stats gathering.
markshannon Mar 27, 2024
ccceffb
Better type safety. Fewer downcasts, some more upcasts
markshannon Mar 28, 2024
7700177
Merge branch 'main' into inline-values
markshannon Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting
  • Loading branch information
markshannon committed Feb 24, 2024
commit 09121f90f128389a98df53f40ca00e3656b58eef
11 changes: 6 additions & 5 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3605,11 +3605,12 @@ dict_dict_merge(PyInterpreterState *interp, PyDictObject *mp, PyDictObject *othe
PyDictKeysObject *okeys = other->ma_keys;

// If other is clean, combined, and just allocated, just clone it.
if (mp->ma_values == NULL &&
other->ma_values == NULL &&
other->ma_used == okeys->dk_nentries &&
(DK_LOG_SIZE(okeys) == PyDict_LOG_MINSIZE ||
USABLE_FRACTION(DK_SIZE(okeys)/2) < other->ma_used)) {
if (mp->ma_values == NULL &&
other->ma_values == NULL &&
other->ma_used == okeys->dk_nentries &&
(DK_LOG_SIZE(okeys) == PyDict_LOG_MINSIZE ||
USABLE_FRACTION(DK_SIZE(okeys)/2) < other->ma_used)
) {
uint64_t new_version = _PyDict_NotifyEvent(
interp, PyDict_EVENT_CLONED, mp, (PyObject *)other, NULL);
PyDictKeysObject *keys = clone_combined_dict_keys(other);
Expand Down