Replies: 1 comment
-
If this would work, then it should also work to include thread_alloc in cppad_lib; i.e., you could making your small library part of You would probably have to to this for all the statics used by CppAD. These should be listed in Note that you will only be able to do this for a limited number of Base types. If you get this to work to your satisfaction, please create a pull request that has your additions to cppad_lib. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
thread_alloc
is used widely in CppAD as the allocator. However, it uses static data in function as the global storage, which does not work well with Windows DLL. If I haveA.dll
andB.dll
both linked with static library of CppAD, there will be two instances ofthread_alloc
. Passing CppAD objects between these DLLs causes memory corruption.I find the previous comment has pointed out this issue.
I plan to solve this issue by building a small DLL containing some of the
thread_alloc
methods with static data to share it between DLLs.Is there a better solution to this problem?
Beta Was this translation helpful? Give feedback.
All reactions