I think that another thing that would be useful is to somehow detectthe problem that two folks have mentioned having on windows. (Where
they are using a debug build of the program and a release build of
libprotobuf.dll.) It would be nice if this either raised a runtime
error or just worked. (I don't see why it shouldn't just work...)
Ok. I asked a friend who knows about Windows. He thinks it's the msvcruntime library being linked to, just like you mentioned. See:
http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx
Out of curiosity, how do you arrive at this? If the libprotobuf code
is compiled using headers with _DEBUG defined, and your code isn't (or
visa versa), isn't it easily possible that the structure of objects
and such could change in the headers due to that flag?
New to this list but maybe this is useful.
If you are allocating an object (new) in one loadable module (e.g. EXE or
DLL) and
deallocating (delete) in another, then that is your problem. Each module is
running its
own heap.
That's not a problem attributable to STL or protocol buffers. Its
lower-level than that.
There is a workaround but its limited. You have to be the owner+author of
the
DLL because you need to revector the global new+delete operators to use the
parent load module (i.e. EXE).
Cheers.
I could plan a port for AS3, is there a prefered way to do that ?
is it ok if I work on my own branch and submit a big patch,
or is it preferrable to submit small patch one after another ?
Out of curiosity, how do you arrive at this? If the libprotobuf codeis compiled using headers with _DEBUG defined, and your code isn't (or
visa versa), isn't it easily possible that the structure of objects
and such could change in the headers due to that flag?
If you are allocating an object (new) in one loadable module (e.g. EXE or
DLL) and
deallocating (delete) in another, then that is your problem. Each module is
running its
own heap.
Its not just the heap but anything that is of global scope in the
C runtime - each loadable module will have its own copy.
Why did MS do it that way? How is the loader going to know the
addresses of C runtime objects in an EXE and set them in each
freshly loaded DLL? Loaders dont know about C runtimes or even
C. I've found the symptoms of this pretty inconvenient too but I
cant see that there is any design/implementation question to
answer here.
ps:
This is a re-send of mail I sent direct to Kenton. Think I've been
treating this list the wrong way. Sorted now.
Why did MS do it that way? How is the loader going to know the
addresses of C runtime objects in an EXE and set them in each
freshly loaded DLL? Loaders dont know about C runtimes or even
C. I've found the symptoms of this pretty inconvenient too but I
cant see that there is any design/implementation question to
answer here.
Having written a bunch of loader code in the past I'm curious. What
other
way is there for OSs to do it?