From 0e588c71c0bbb390d0ff8a6227df896fad4bb025 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 12 Dec 2013 14:54:06 +0000 Subject: [PATCH] flush the EMF cache in REINITIALIZE-INSTANCE of SPECIALIZABLE-GENERIC-FUNCTION --- specializable.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5