[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] mintlib and shareable libraries



Hello,

I have a question to make the thing clear in my mind: is mintlib ready to build "shareable" libraries (by shareable libraries i mean shareable slb or ldg) ?

Here is just an example.

A process (let's call it p1) call one of the library (slb/ldg) function. This function call malloc(), mintlib (within the ldg/slb) will perform a big Malloc(), and the area returned by malloc() will be a small part of the big Malloc. Who own this Malloc ? Is it the process that has called this library function (p1) ?

Later, another process (p2) call the same library fuction, which one call once more malloc(). The area returned by this malloc will be another part of the Malloc() allocated in the previous call. At this moment, the 2nd process (p2) is working on a memory area owned by the 1st process. Right ?

Later, if process 1 ended, mint will automatically free the memory allocated by this process, and so the big Malloc() of the library will be free-ed... and p2 will work on a memory that may be allocated by another process at any time.

Am i right ?

best regards,
Arnaud.