[fdo-internals] Removal of FdoPtr Null check

Carsten Hess carsten.hess at autodesk.com
Fri Jun 12 11:02:33 EDT 2009


We have been doing some research inside of Autodesk on one aspect of the current FdoPtr implementation. The definition of this smart pointer contains a NULL check that throws an Fdo exception if a NULL pointer is accessed. This is a behavior unlike any other smart pointer implementation we are aware of at this point.

While this check does provide some help in keeping programs based on FDO more stable it has a variety of problems associated with it. Most prominently it increases DLL sizes quite a bit due to in-lining of the FdoPtr method and has a small negative performance impact on our applications. Also, the way it is used today this code can potentially create memory corruption as the exception could be thrown by the FDO dll while the destruction of the exception happens in the application code.

With that I would like to propose that we remove this NULL check and recommend that applications implement the operating system exception handler for accessing invalid memory. This would then handle all NULL pointer accesses and not just FDO null pointer access.

What do you all think about this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-internals/attachments/20090612/1339c52e/attachment.html

More information about the fdo-internals mailing list