* foreign procedures are now represented as bytevectors instead of
strings.
This commit is contained in:
parent
dfe8e0e1c1
commit
10f5e53338
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -149,7 +149,13 @@ ik_relocate_code(ikp code){
|
|||
else if(tag == 1){
|
||||
/* foreign object */
|
||||
ikp str = ref(p, wordsize);
|
||||
char* name = string_data(str);
|
||||
char* name;
|
||||
if(tagof(str) == bytevector_tag){
|
||||
name = (char*) str + off_bytevector_data;
|
||||
} else {
|
||||
fprintf(stderr, "foreign name is not a bytevector\n");
|
||||
exit(-1);
|
||||
}
|
||||
void* sym = dlsym(RTLD_DEFAULT, name);
|
||||
char* err = dlerror();
|
||||
if(err){
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -868,9 +868,13 @@
|
|||
(vector-set! vec (fx+ reloc-idx 1) v)
|
||||
(set! reloc-idx (fx+ reloc-idx 2))]
|
||||
[(foreign-label)
|
||||
(vector-set! vec reloc-idx (fxlogor 1 (fxsll idx 2)))
|
||||
(vector-set! vec (fx+ reloc-idx 1) v)
|
||||
(set! reloc-idx (fx+ reloc-idx 2))]
|
||||
(let ([name
|
||||
(if (string? v)
|
||||
(string->utf8-bytevector v)
|
||||
(error 'whack-reloc "not a string ~s" v))])
|
||||
(vector-set! vec reloc-idx (fxlogor 1 (fxsll idx 2)))
|
||||
(vector-set! vec (fx+ reloc-idx 1) name)
|
||||
(set! reloc-idx (fx+ reloc-idx 2)))]
|
||||
[(reloc-word+)
|
||||
(let ([obj (car v)] [disp (cdr v)])
|
||||
(vector-set! vec reloc-idx (fxlogor 2 (fxsll idx 2)))
|
||||
|
|
Loading…
Reference in New Issue