-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-45953: Statically allocate the main interpreter (and initial thread state). #29883
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
Changes from 1 commit
5e6eda9
de12b98
035eff3
1569a53
518e3f3
9995a84
f22d0da
cf39d57
b840213
3bf69b0
4de466e
9bb32a6
385f298
354997f
9bbf8a0
8d1cf35
188aed8
e0da483
46c7767
7ca8d1c
ed6c273
29e1764
1a83910
8631805
a0569bb
4c3c0f9
47bfa7e
dd69ffa
ba75803
eef3194
8703297
d1eddad
8a8150c
7a37237
b2073ac
21a522d
7b376d4
562ee42
ed8f5cd
6da97b7
cf24942
fac6af6
4aa2073
f135168
2b4ba04
24d1de2
84ae7db
e9de30c
51a32ce
7104518
f7a8389
18080a1
0457119
923ca7a
99c2ae1
3bc73ee
c1808ae
7b98e59
0383eae
c959db0
5b34b42
837bfe6
ebefa35
eb7a080
1ef4a39
771e574
b5c43f1
bfc3906
9b25c8b
e776c31
c6bda1f
8ab6261
ff8de28
b28afb3
0d30300
e193794
e9f1262
a6a6471
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,12 +175,14 @@ struct _ts { | |
} _preallocated; | ||
}; | ||
|
||
#ifdef Py_BUILD_CORE | ||
#define _PyThreadState_INIT \ | ||
{ \ | ||
._preallocated = { \ | ||
.initialized = 1, \ | ||
}, \ | ||
} | ||
#endif | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can it be turned into a variant below? #define _PyThreadState_INIT { ._preallocated.initialized = 1 } There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the tip. What's the advantage? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this is a minor adjustment done while it does not require a separate pull request. More compact declaration is easier to grasp in a single eye swipe. Like _PyThreadState_INIT is the preallocated's initialized set to one versus _PyThreadState_INIT is... the preallocated's initialized set to one... ah, that's it. In isolation of few lines it sounds funny but when a programmer reads the whole file to assemble a picture what pystate is and what it is capable of, they read in zigzags only. |
||
// Alias for backward compatibility with Python 3.8 | ||
#define _PyInterpreterState_Get PyInterpreterState_Get | ||
|
Uh oh!
There was an error while loading. Please reload this page.