Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are correct the memory size is defined at compile time and applications B/C would be in danger of serious memory corruption problems.</p> <p>There is no way to handle this explicitly at the language level. You need to work with the OS to get the appropriate shared libraries to the application.</p> <p>You need to version your libraries.</p> <p>As there is no explicit way of doing this with the build tools you need to do it with file names. If you look at most products this is approx how they work.</p> <p>In the lib directory:</p> <pre><code>libD.1.00.so libD.1.so -&gt; libD.1.00.so // Symbolic link libD.so -&gt; libD.1.so // Symbolic link </code></pre> <p>Now at compile time you specify -lD and it links against libD.1.00.so because it follows the symbolic links. At run time it knows to use this version as this is the version it compiled against.</p> <p>So you now update lib D to version 2.0</p> <p>In the lib directory:</p> <pre><code>libD.1.00.so libD.2.00.so libD.1.so -&gt; libD.1.00.so // Symbolic link libD.2.so -&gt; libD.2.00.so // Symbolic link libD.so -&gt; libD.2.so // Symbolic link </code></pre> <p>Now when you build with -libD it links against version 2. Thus you re-build A and it will use version 2 of the lib from now on; while B and C will still use version 1. If you rebuild B or C it will use the new version of the library unless you explicitly use an old version of the library when building -libD.1</p> <p>Some linkers do not know to follow symbolic links very well so there are linker commands that help. gcc use the '-install_name' flag your linker may have a slightly different named flag.</p> <p>As a runtime check it is usally a good idea to put version information into your shared objects (global variable/function call etc). Thus at runtime you can retrieve the shared libraries version information and check that your application is compatible. If not you should exit with the appropriate error message.</p> <p>Also note: If you serialize objects of D to a file. You know need to make sure that version information about D is maintained. Libd.2 may know how to read version 1 D objects (with some explicit work), but the inverse would not be true.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload