Yep, that's correct - top-level bind-vals are always on the heap.
I should also add that in both cases described by Toby the final
"argument" is optional - defaulting to an uninitialised value in the
"normal" case and a "1" in the "number of elements" case.
Someone should clear this up in the docs and submit a pull request :)
Cheers
Ben
hackspanner <
hacks...@gmail.com> writes:
> Ah, I see. So then the ptr is allocated on the heap with halloc?
>
> On Wednesday, April 20, 2016 at 9:58:10 PM UTC-7, Dr Offig wrote:
>>
>> Hi Dave, the syntax for (bind-val) is a bit different to the way you are
>> using it. The syntax (or perhaps semantics) depends on whether you are
>> binding a pointer value or a normal value.
>>
>> Normal: (bind-val *<variable-name>* <*variable-type*> <*value*>)
>> Pointer: (bind-val <*variable-name*> <*variable-type*>* <
>> *number-of-elements-to-allocate*>)
>>
>> So, your first line should be (bind-val ptr i32* 1) if you just want a
>> single pointer.
>>
>>
>>
>>
>>
>> On Thu, Apr 21, 2016 at 2:47 PM, Ben Swift <
b...@benswift.me <javascript:>
>>> email to
extemporelan...@googlegroups.com <javascript:>.