added factorvm ptrs to the rest of alien functions.
(Left commented debug lines to remind me that these haven't been tested yet, and some are osx specific)db4
parent
e98f168a11
commit
12ca7bdc57
30
vm/alien.cpp
30
vm/alien.cpp
|
@ -224,10 +224,10 @@ char *factorvm::unbox_alien()
|
|||
return alien_offset(dpop());
|
||||
}
|
||||
|
||||
VM_C_API char *unbox_alien()
|
||||
VM_C_API char *unbox_alien(factorvm *myvm)
|
||||
{
|
||||
printf("PHIL unbox_alien\n");fflush(stdout);
|
||||
return vm->unbox_alien();
|
||||
//printf("PHIL unbox_alien %d %d\n",vm,myvm);fflush(stdout);
|
||||
return VM_PTR->unbox_alien();
|
||||
}
|
||||
|
||||
/* make an alien and push */
|
||||
|
@ -251,10 +251,10 @@ void factorvm::to_value_struct(cell src, void *dest, cell size)
|
|||
memcpy(dest,alien_offset(src),size);
|
||||
}
|
||||
|
||||
VM_C_API void to_value_struct(cell src, void *dest, cell size)
|
||||
VM_C_API void to_value_struct(cell src, void *dest, cell size, factorvm *myvm)
|
||||
{
|
||||
printf("PHIL to_value_struct\n");
|
||||
return vm->to_value_struct(src,dest,size);
|
||||
//printf("PHIL to_value_struct %d %d\n",vm,myvm);fflush(stdout);
|
||||
return VM_PTR->to_value_struct(src,dest,size);
|
||||
}
|
||||
|
||||
/* for FFI callbacks receiving structs by value */
|
||||
|
@ -265,10 +265,10 @@ void factorvm::box_value_struct(void *src, cell size)
|
|||
dpush(tag<byte_array>(bytes));
|
||||
}
|
||||
|
||||
VM_C_API void box_value_struct(void *src, cell size)
|
||||
VM_C_API void box_value_struct(void *src, cell size,factorvm *myvm)
|
||||
{
|
||||
printf("PHIL box_value_struct\n");
|
||||
return vm->box_value_struct(src,size);
|
||||
//printf("PHIL box_value_struct %d %d\n",vm,myvm);fflush(stdout);
|
||||
return VM_PTR->box_value_struct(src,size);
|
||||
}
|
||||
|
||||
/* On some x86 OSes, structs <= 8 bytes are returned in registers. */
|
||||
|
@ -280,10 +280,10 @@ void factorvm::box_small_struct(cell x, cell y, cell size)
|
|||
box_value_struct(data,size);
|
||||
}
|
||||
|
||||
VM_C_API void box_small_struct(cell x, cell y, cell size)
|
||||
VM_C_API void box_small_struct(cell x, cell y, cell size, factorvm *myvm)
|
||||
{
|
||||
printf("PHIL box_small_struct\n");
|
||||
return vm->box_small_struct(x,y,size);
|
||||
//printf("PHIL box_small_struct %d %d\n",vm,myvm);fflush(stdout);
|
||||
return VM_PTR->box_small_struct(x,y,size);
|
||||
}
|
||||
|
||||
/* On OS X/PPC, complex numbers are returned in registers. */
|
||||
|
@ -297,10 +297,10 @@ void factorvm::box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size)
|
|||
box_value_struct(data,size);
|
||||
}
|
||||
|
||||
VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size)
|
||||
VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size, factorvm *myvm)
|
||||
{
|
||||
printf("PHIL box_medium_struct\n");
|
||||
return vm->box_medium_struct(x1, x2, x3, x4, size);
|
||||
//printf("PHIL box_medium_struct %d %d\n",vm,myvm);fflush(stdout);
|
||||
return VM_PTR->box_medium_struct(x1, x2, x3, x4, size);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
10
vm/alien.hpp
10
vm/alien.hpp
|
@ -37,11 +37,11 @@ PRIMITIVE(dlclose);
|
|||
PRIMITIVE(dll_validp);
|
||||
|
||||
VM_C_API char *alien_offset(cell object, factorvm *vm);
|
||||
VM_C_API char *unbox_alien();
|
||||
VM_C_API char *unbox_alien(factorvm *vm);
|
||||
VM_C_API void box_alien(void *ptr, factorvm *vm);
|
||||
VM_C_API void to_value_struct(cell src, void *dest, cell size);
|
||||
VM_C_API void box_value_struct(void *src, cell size);
|
||||
VM_C_API void box_small_struct(cell x, cell y, cell size);
|
||||
VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size);
|
||||
VM_C_API void to_value_struct(cell src, void *dest, cell size, factorvm *vm);
|
||||
VM_C_API void box_value_struct(void *src, cell size,factorvm *vm);
|
||||
VM_C_API void box_small_struct(cell x, cell y, cell size,factorvm *vm);
|
||||
VM_C_API void box_medium_struct(cell x1, cell x2, cell x3, cell x4, cell size,factorvm *vm);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue