| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Skip the marshal step for frozen modules by generating C code that produces a set of ready-to-use code objects. This speeds up startup time by another 10% or more. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
|
|
||
| /* Frozen modules bootstrap */ | ||
|
|
||
| /* This file is linked with "bootstrap Python" | ||
| which is used (only) to run Tools/scripts/deepfreeze.py. */ | ||
|
|
||
| #include "Python.h" | ||
| #include "pycore_import.h" | ||
|
|
||
| /* Includes for frozen modules: */ | ||
| #include "frozen_modules/importlib._bootstrap.h" | ||
| #include "frozen_modules/importlib._bootstrap_external.h" | ||
| #include "frozen_modules/zipimport.h" | ||
| /* End includes */ | ||
|
|
||
| /* Note that a negative size indicates a package. */ | ||
|
|
||
| static const struct _frozen bootstrap_modules[] = { | ||
| {"_frozen_importlib", _Py_M__importlib__bootstrap, (int)sizeof(_Py_M__importlib__bootstrap)}, | ||
| {"_frozen_importlib_external", _Py_M__importlib__bootstrap_external, (int)sizeof(_Py_M__importlib__bootstrap_external)}, | ||
| {"zipimport", _Py_M__zipimport, (int)sizeof(_Py_M__zipimport)}, | ||
| {0, 0, 0} /* bootstrap sentinel */ | ||
| }; | ||
| static const struct _frozen stdlib_modules[] = { | ||
| {0, 0, 0} /* stdlib sentinel */ | ||
| }; | ||
| static const struct _frozen test_modules[] = { | ||
| {0, 0, 0} /* test sentinel */ | ||
| }; | ||
| const struct _frozen *_PyImport_FrozenBootstrap = bootstrap_modules; | ||
| const struct _frozen *_PyImport_FrozenStdlib = stdlib_modules; | ||
| const struct _frozen *_PyImport_FrozenTest = test_modules; | ||
|
|
||
| static const struct _module_alias aliases[] = { | ||
| {"_frozen_importlib", "importlib._bootstrap"}, | ||
| {"_frozen_importlib_external", "importlib._bootstrap_external"}, | ||
| {0, 0} /* aliases sentinel */ | ||
| }; | ||
| const struct _module_alias *_PyImport_FrozenAliases = aliases; | ||
|
|
||
|
|
||
| /* Embedding apps may change this pointer to point to their favorite | ||
| collection of frozen modules: */ | ||
|
|
||
| const struct _frozen *PyImport_FrozenModules = NULL; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| This directory contains the generated .c files for all the deep-frozen | ||
| modules. Python/frozen.c depends on these files. | ||
|
|
||
| None of these files are committed into the repo. | ||
|
|
||
| See Tools/scripts/freeze_modules.py for more info. |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis file is essentially identical to Python/frozen.c if we cut out the non-bootstrap parts, right? So could we just use frozen.c with something like #ifndef FROZEN_BOOTRAP around the non-bootstrap parts?
Otherwise I recommend generating the parts of this file with Tools/scripts/freeze_modules.py, the same as with frozen.c. If we don't then this will break when someone adds another module to the BOOTSTRAP list in freeze_modules.py.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.