Dear Marc,<br><br>Can a present object (u8vector etc.) be switched between ___STILL / ___MOVABLE / ___PERMANENT, if so how from Scheme respectively C?<br><br>Also just to check, on vector create-time there's no way to specify GC object type right (in make-u8vector etc.)?<br>

<br>Many thanks,<br>Mikael<br><br><div class="gmail_quote">2010/3/30 Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
On 2010-03-30, at 10:34 AM, Alex Queiroz wrote:<br>
<br>
>     I always use ___FETCH_U* with a C integer as the second argument,<br>
> i. e., I don't use the ___INT() conversion macro.<br>
<br>
</div>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.<br>
<br>
The simplest way to do what you want is:<br>
<br>
char *u8vectorptr = ___CAST(char*,___BODY(theu8vectorschemeobjectvariable));<br>
<br>
then<br>
<br>
u8vectorptr[i] = ...;<br>
<br>
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.<br>
<font color="#888888"><br>
Marc<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br>