mirror of
https://github.com/python/cpython.git
synced 2026-10-28 18:35:21 +08:00
The marshal writer decided whether an object can be referenced later (FLAG_REF) from its reference count, so the output for the same value depended on what else in the process held a reference to its parts, and differed between the default and the free-threaded builds' view of the same objects. This is the remaining cause of gh-129724 and the cause of gh-156504. FLAG_REF is now set exactly on the objects which are written more than once in the dump. The writer still makes one pass: it records the position of the type byte of each object it remembers and of each TYPE_REF, and when the dump is complete it sets the flags and renumbers the references. A reference count of one is only used to skip the hashtable. Interned strings are no longer flagged unconditionally. The reader is unchanged and the format version is not bumped: both the old and the new output are loaded by old and new readers. PyMarshal_WriteObjectToFile() now builds the data in memory and writes it with one fwrite(), since the flags are only known at the end. Nothing is written if the object cannot be marshalled.
40 lines
1.9 KiB
C
Generated
40 lines
1.9 KiB
C
Generated
// Auto-generated by Programs/freeze_test_frozenmain.py
|
|
unsigned char M_test_frozenmain[] = {
|
|
99,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,
|
|
0,0,0,0,0,115,188,0,0,0,128,0,0,0,90,0,
|
|
77,7,69,0,112,0,90,0,77,7,69,4,112,1,89,2,
|
|
31,0,78,1,50,1,0,0,0,0,0,0,29,0,89,2,
|
|
31,0,78,2,89,0,76,6,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,50,2,0,0,0,0,
|
|
0,0,29,0,89,1,76,8,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,31,0,50,0,0,0,
|
|
0,0,0,0,78,3,42,26,0,0,0,0,0,0,0,0,
|
|
0,0,112,5,78,6,67,0,0,0,65,24,0,0,112,6,
|
|
89,2,31,0,78,4,89,6,12,0,78,5,89,5,89,6,
|
|
42,26,0,0,0,0,0,0,0,0,0,0,12,0,48,4,
|
|
50,1,0,0,0,0,0,0,29,0,71,26,0,0,9,0,
|
|
28,0,77,7,33,0,41,7,105,0,0,0,0,122,18,70,
|
|
114,111,122,101,110,32,72,101,108,108,111,32,87,111,114,108,
|
|
100,122,8,115,121,115,46,97,114,103,118,218,6,99,111,110,
|
|
102,105,103,122,7,99,111,110,102,105,103,32,122,2,58,32,
|
|
41,5,90,12,112,114,111,103,114,97,109,95,110,97,109,101,
|
|
90,10,101,120,101,99,117,116,97,98,108,101,90,15,117,115,
|
|
101,95,101,110,118,105,114,111,110,109,101,110,116,90,17,99,
|
|
111,110,102,105,103,117,114,101,95,99,95,115,116,100,105,111,
|
|
90,14,98,117,102,102,101,114,101,100,95,115,116,100,105,111,
|
|
41,7,90,3,115,121,115,90,17,95,116,101,115,116,105,110,
|
|
116,101,114,110,97,108,99,97,112,105,90,5,112,114,105,110,
|
|
116,90,4,97,114,103,118,90,11,103,101,116,95,99,111,110,
|
|
102,105,103,115,114,0,0,0,0,90,3,107,101,121,41,0,
|
|
243,0,0,0,0,90,18,116,101,115,116,95,102,114,111,122,
|
|
101,110,109,97,105,110,46,112,121,218,8,60,109,111,100,117,
|
|
108,101,62,114,2,0,0,0,1,0,0,0,115,94,0,0,
|
|
0,241,3,1,1,1,243,8,0,1,11,219,0,24,225,0,
|
|
5,208,6,26,212,0,27,217,0,5,128,106,144,35,151,40,
|
|
145,40,212,0,27,216,9,26,215,9,38,210,9,38,211,9,
|
|
40,168,24,213,9,50,128,6,244,2,6,12,2,128,67,241,
|
|
14,0,5,10,136,71,144,67,144,53,152,2,152,54,160,35,
|
|
157,59,152,45,208,10,40,214,4,41,243,15,6,12,2,114,
|
|
1,0,0,0,
|
|
};
|