Isolating and Multiplying C Library Instance Creation in a Process

We have a C library (.lib windows and .a linux), which allows you to create a singleton mode, which also does not close properly (memory leak and streams that survived) were once created.

By rewriting it and brushing off errors, is there an easy way to isolate this incorrect code in the process, so that the Singleton constraint can be removed, and the dirty tidyup can be sandboxed?

Basically, I'm interested in any options in the process, if they really are. A separate process will obviously solve it, but it will require architectural overhead to allow remote control of the library if there are no very weak solutions for this (it has a wide API, so saving a large amount of glue is not particularly attractive).

+8
c ++ c ipc
source share
1 answer

Sorry, but there is no easy way to do this. A sandbox with poorly functioning libraries is usually run using separate processes that you have already proposed for yourself. An IPC tool, such as protocol buffers, can help in defining and implementing the IPC protocol.

+2
source share

All Articles