In Gambit internally, if the C code (as part of allocating a device port or whatever) wants to allocate an integer object (so, a Scheme fixnum or bignum) or other object, how is this done?<div><br></div><div>I guess the main thing is that there needs to be a failure path, that's trigged.. in case of heap overflow only, or would there be some stack-technical things a that could make object allocation fail?</div>

<div><br></div><div>Brgds</div><div><br><div class="gmail_quote">2013/3/26 Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">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="HOEnZb"><div class="h5"><br>
On 2013-03-26, at 10:17 AM, Jason Felice <<a href="mailto:jason.m.felice@gmail.com">jason.m.felice@gmail.com</a>> wrote:<br>
<br>
><br>
> I don't have the environment to use the ___BEGIN_ALLOC_VECTOR() macros. (No ___hp).<br>
><br>
> I know the size ahead of time.  If possible, I'd like to avoid passing ___hp all the way down.<br>
><br>
> Actually, this is one place where I'd love documentation - the environment for writing C functions and how things are protected from gc, etc.   I can put it together after I figure it out.<br>
<br>
</div></div>Use this instead:<br>
<br>
long length = 100;<br>
___SCMOBJ init = ___FAL;<br>
___SCMOBJ v = ___EXT(___make_vector)(length, init, ___STILL);<br>
<br>
An alternative is to create the vector in Scheme, and pass it to C to be filled in using mutation.<br>
Marc<br>
<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>
</blockquote></div><br></div>