fix long-standing debug-name confusion
[sbcl.git] / src / code / foreign.lisp
index cd83867..a735e76 100644 (file)
@@ -16,7 +16,8 @@
 
 (defun extern-alien-name (name)
   (handler-case
-      (coerce name 'base-string)
+      #!-win32 (coerce name 'base-string)
+      #!+win32 (concatenate 'base-string "_" name)
     (error ()
       (error "invalid external alien name: ~S" name))))
 
@@ -138,7 +139,10 @@ if the symbol isn't found."
                                (symbol-address unsigned)))
                  (dladdr (function unsigned unsigned (* (struct dl-info)))
                          :extern "dladdr"))
-      (let ((err (alien-funcall dladdr addr (addr info))))
+      (let ((err (without-gcing
+                   ;; On eg. Darwin GC can could otherwise interrupt
+                   ;; the call while dladdr is holding a lock.
+                   (alien-funcall dladdr addr (addr info)))))
         (if (zerop err)
             nil
             (slot info 'symbol))))