pyroniasys / pyronia-cpython

Pyronia-aware implementation of CPython
Other
1 stars 1 forks source link

Investigate if native extention dependencies are independently linked into each extension #1

Closed masomel closed 6 years ago

masomel commented 6 years ago

The question here is whether two different native extensions that both have the same dependency each have a separate "copy" of the library as part of their binary. If this is the case, we can safely isolate each native extension into its separate memory domain without worrying about inter-native library interactions.

Cases to investigate:

masomel commented 6 years ago

I ran memory tests comparing function pointer memory addresses in various native library import scenarios (see tests 6, 7, and 8 in https://gist.github.com/masomel/a13130597095bb20ef2378a7ea6284bf). Based on these results, Python defaults to dynamically linking/loading native extension dependencies, meaning that different native extensions with the same dependency reference the same library in memory.