mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-04 18:34:14 +00:00
Rewrites (and makes static) findptrsbuffer to avoid multiple conversions between Lisp and native pointers
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
#define GCFINALDEFS_H 1
|
||||
#include "lispemul.h" /* for LispPTR, DLword */
|
||||
void printarrayblock(LispPTR base);
|
||||
LispPTR findptrsbuffer(LispPTR ptr);
|
||||
LispPTR releasingvmempage(LispPTR ptr);
|
||||
LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist);
|
||||
LispPTR deleteblock(LispPTR base);
|
||||
|
||||
@@ -138,14 +138,16 @@ static int integerlength(unsigned int n) {
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
LispPTR findptrsbuffer(LispPTR ptr) {
|
||||
struct buf *bptr;
|
||||
bptr = (struct buf *)NativeAligned4FromLAddr(*System_Buffer_List_word);
|
||||
while (LAddrFromNative(bptr) != NIL) {
|
||||
if (ptr == bptr->vmempage)
|
||||
return (LAddrFromNative(bptr));
|
||||
else
|
||||
bptr = (struct buf *)NativeAligned4FromLAddr(bptr->sysnext);
|
||||
static LispPTR findptrsbuffer(LispPTR ptr) {
|
||||
LispPTR buf;
|
||||
struct buf *buf_np;
|
||||
buf = *System_Buffer_List_word;
|
||||
while (buf != NIL) {
|
||||
buf_np = (struct buf *)NativeAligned4FromLAddr(buf);
|
||||
if (ptr == buf_np->vmempage) {
|
||||
return (buf);
|
||||
}
|
||||
buf = buf_np->sysnext;
|
||||
}
|
||||
return (NIL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user