From: Christophe Rhodes Date: Thu, 12 Dec 2013 14:54:06 +0000 (+0000) Subject: flush the EMF cache in REINITIALIZE-INSTANCE of SPECIALIZABLE-GENERIC-FUNCTION X-Git-Tag: els2014-submission~29 X-Git-Url: http://christophe.rhodes.io/gitweb/?p=specializable.git;a=commitdiff_plain;h=0e588c71c0bbb390d0ff8a6227df896fad4bb025 flush the EMF cache in REINITIALIZE-INSTANCE of SPECIALIZABLE-GENERIC-FUNCTION --- diff --git a/specializable.lisp b/specializable.lisp index 29ad926..979f514 100644 --- a/specializable.lisp +++ b/specializable.lisp @@ -112,7 +112,7 @@ ;;; FIXME: in some kind of order, the discriminating function needs to handle: ;;; - argument count checking; ;;; - keyword argument validity; -;;; - flushing the emf cache on method addition/removal +;;; - DONE flushing the emf cache on method addition/removal ;;; - flushing the cache on class redefinition; ;;; - cache thread-safety. (defmethod sb-mop:compute-discriminating-function ((gf specializable-generic-function)) @@ -124,6 +124,9 @@ (sb-pcl::invoke-emf emfun args) (slow-method-lookup gf args generalizers))))) +(defmethod reinitialize-instance :after ((gf specializable-generic-function) &key) + (clrhash (emf-table gf))) + (defun slow-method-lookup (gf args generalizers) ;; differs from closette (multiple-value-bind (applicable-methods definitivep)