Skip to content
Snippets Groups Projects
This project is mirrored from https://git.alchemyviewer.org/alchemy/alchemy-next.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer or owner.
  1. Apr 06, 2017
  2. Apr 03, 2017
  3. Mar 30, 2017
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      DRTVWR-418: Xcode 8.3 complains about LLSafeHandle<T> implementation. · e9fe0714
      Nat Goodspeed authored
      The previous LLSafeHandle<T> implementation declares a static data member of
      the template class but provides no (generic) definition, relying on particular
      specializations to provide the definition. The data member is a function
      pointer, which is called in one of the methods to produce a pointer to a
      "null" T instance: that is, a dummy instance to be dereferenced in case the
      wrapped T* is null.
      
      Xcode 8.3's version of clang is bothered by the call, in a generic method,
      through this (usually) uninitialized pointer. It happens that the only
      specializations of LLSafeHandle do both provide definitions. I don't know
      whether that's formally valid C++03 or not; but I agree with the compiler: I
      don't like it.
      
      Instead of declaring a public static function pointer which each
      specialization is required to define, add a protected static method to the
      template class. This protected static method simply returns a pointer to a
      function-static T instance. This is functionally similar to a static
      LLPointer<T> set on demand (as in the two specializations), including lazy
      instantiation.
      
      Unlike the previous implementation, this approach prohibits a given
      specialization from customizing the "null" instance function. Although there
      exist reasonable ways to support that (e.g. a related traits template), I
      decided not to complicate the LLSafeHandle implementation to make it more
      generally useful. I don't really approve of LLSafeHandle, and don't want to
      see it proliferate. It's not clear that unconditionally dereferencing
      LLSafeHandle<T> is in any way better than conditionally dereferencing
      LLPointer<T>. It doesn't even skip the runtime conditional test; it simply
      obscures it. (There exist hints in the code that at one time it might have
      immediately replaced any wrapped null pointer value with the pointer to the
      "null" instance, obviating the test at dereference time, but this is not the
      current functionality. Perhaps it was only ever wishful thinking.)
      
      Remove the corresponding functions and static LLPointers from the two classes
      that use LLSafeHandle.
      e9fe0714
  4. Mar 29, 2017
  5. Mar 21, 2017
  6. Mar 16, 2017
  7. Mar 15, 2017
  8. Mar 14, 2017
  9. Mar 13, 2017
  10. Mar 12, 2017
  11. Mar 11, 2017
  12. Mar 10, 2017
  13. Mar 09, 2017
  14. Mar 08, 2017
  15. Mar 06, 2017
  16. Mar 03, 2017
Loading