--On November 18, 2011 2:17:26 AM -0800 Kyle Husmann <kyle.husm...@gmail.com> wrote:

On Thu, Nov 17, 2011 at 4:02 AM, Keith J. Schultz
<keithjschu...@web.de> wrote:
Just good programming practices and experience.

On Thu, Nov 17, 2011 at 6:41 PM, Mike
Alexander <m...@umich.edu> wrote:
I learned what I know about it from experience and talking to other
developers.

Are there some simple rules of thumb I can follow then?

I gave some general ideas in a previous message in this thread: "You have to be careful that objects don't leak out of one library (compiled with compiler X) into another library (compiled with compiler Y). I suspect this isn't a problem with most libraries in MacPorts since the APIs have been designed to avoid problems like this, but it could happen. As long as any object created by a given library is treated as an opaque pointer outside that library, you're probably ok."

In general make sure that everything that accesses a given object is compiled by the same compiler and that everything else treats the object pointer as an opaque pointer. Even in C code you can sometimes get in trouble if one library allocates something and a different library releases it, depending on exactly how you do the allocation and release.

    Mike

_______________________________________________
macports-users mailing list
macports-users@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to