Dear Marc,
Can a present object (u8vector etc.) be switched between ___STILL / ___MOVABLE / ___PERMANENT, if so how from Scheme respectively C?
Also just to check, on vector create-time there's no way to specify GC object type right (in make-u8vector etc.)?
Many thanks, Mikael
2010/3/30 Marc Feeley feeley@iro.umontreal.ca
On 2010-03-30, at 10:34 AM, Alex Queiroz wrote:
I always use ___FETCH_U* with a C integer as the second argument,
i. e., I don't use the ___INT() conversion macro.
Indeed the ___INT(x) macro converts the fixnum x into a C int. It is the inverse of the ___FIX(n) macro which converts a C int into a fixnum.
The simplest way to do what you want is:
char *u8vectorptr = ___CAST(char*,___BODY(theu8vectorschemeobjectvariable));
then
u8vectorptr[i] = ...;
Note that you can only do this if the u8vector will not move (it is either a ___STILL or ___PERM object, or you don't make any calls back to Scheme or the Gambit memory allocator inside your C function.
Marc
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list