* * *

Author Topic: Dynamic lib doubtful juggling...  (Read 148 times)

MiniApp

  • New member
  • *
  • Posts: 6
Dynamic lib doubtful juggling...
« on: May 24, 2017, 07:26:06 pm »
Hello,

I work on dynamic library and a software.

I have a library, other (multiple) libraries use it. But my host application will load this library and libraries wich use the base library (you can be :o).

This library is loaded by a common unit, the initialization section contain a StartCore. Functions are loaded with the syntax
Code: Pascal  [Select]
  1. procedure Anyone({something...});register;external 'MyLib.so';
  2. // ...
  3. initialization
  4. if not StartCore(LibInfos) then
  5.   halt(2);
  6. // ...
  7. end.

I would like know if the library space into the process is common or duplicated beetwen libs and main program?

I'm on Linux but I would like this work on Mac and many other (Windows is optionnal  :D)

I think use a variable into the library or a environment variable to avoid multiple StartCore.

Answer or comments ? I have not tested it. Thank you if you clear this suspicious game... >:D
French and under the latest Ubuntu ;-p !

Phil

  • Hero Member
  • *****
  • Posts: 2068
Re: Dynamic lib doubtful juggling...
« Reply #1 on: May 24, 2017, 07:42:46 pm »
I would like know if the library space into the process is common or duplicated beetwen libs and main program?

This would be easy for you to test, but I believe each process gets its own copy of global variables.

To share global variables between processes, you'll probably need to use shared memory.


Unrelated to your question, but some dynamic library tips here that you might find interesting:

https://macpgmr.github.io/MacXPlatform/PascalDynLibs.html


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus