From ed047145d89fba3bd7d44f00be957afedeafcbae Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 19 Jun 2005 16:01:59 +0000 Subject: [PATCH] 0.9.1.56: start of an internals manual * documenting initially "Foreign Linkage": linkage table, lazy aliens, and callbacks. --- src/code/target-alieneval.lisp | 32 +------------------------------- version.lisp-expr | 2 +- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/code/target-alieneval.lisp b/src/code/target-alieneval.lisp index 4ae19e5..019991d 100644 --- a/src/code/target-alieneval.lisp +++ b/src/code/target-alieneval.lisp @@ -726,37 +726,7 @@ ;;;; ALIEN CALLBACKS ;;;; -;;;; An alien callback sequence has 4 parts / stages / bounces: -;;;; -;;;; * ASSEMBLER WRAPPER that saves the arguments from the C-call -;;;; according to the alien-fun-type of the callback, and calls -;;;; #'ENTER-ALIEN-CALLBACK with the index indentifying the -;;;; callback, a pointer to the arguments copied on the stack and a -;;;; pointer to return value storage. When control returns to the -;;;; wrapper it returns the value to C. There is one assembler -;;;; wrapper per callback.[1] The SAP to the wrapper code vector -;;;; is what is passed to foreign code as a callback. -;;;; -;;;; * #'ENTER-ALIEN-CALLBACK pulls the LISP TRAMPOLINE for the given -;;;; index, and calls it with the argument and result pointers. -;;;; -;;;; * LISP TRAMPOLINE that calls the LISP WRAPPER with the argument -;;;; and result pointers, and the function designator for the -;;;; callback. There is one lisp trampoline per callback. -;;;; -;;;; * LISP WRAPPER parses the arguments from stack, calls the actual -;;;; callback with the arguments, and saves the return value at the -;;;; result pointer. The lisp wrapper is shared between all the -;;;; callbacks having the same same alien-fun-type. -;;;; -;;;; [1] As assembler wrappers need to be allocated in static -;;;; addresses and are (in the current scheme of things) never -;;;; released it might be worth it to split it into two parts: -;;;; per-callback trampoline that pushes the index of the lisp -;;;; trampoline on the stack, and jumps to the appropriate assembler -;;;; wrapper. The assembler wrapper could then be shared between all -;;;; the callbacks with the same alien-fun-type. This would amortize -;;;; most of the static allocation costs between multiple callbacks. +;;;; See "Foreign Linkage / Callbacks" in the SBCL Internals manual. (defvar *alien-callback-info* nil "Maps SAPs to corresponding CALLBACK-INFO structures: contains all the diff --git a/version.lisp-expr b/version.lisp-expr index 202c7cd..33e0104 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.1.55" +"0.9.1.56" -- 1.7.10.4