NEWTON

NEWTON


Popular tags

    a pointer with a hint, without doing a memory allocation

    Asked

    4 months ago

    5

    views


    0

    This isn't a starknet question, but raw cairo. is it possible to use a pointer reference like let, and set it to a pointer with a hint, without doing a memory allocation?

    looks like the answer is yes, but you do need to assign a reference when you declare a pointer reference with let, but that doesn't alter the memory

    e.g.

    let s : felt* = cast(ap, felt*) { ids.s = some_other_reference }

    the cast(ap, felt*) does nothing, just satisfies the compiler by having something on the rhs of a let

      cairocairo-lang

    Newton

    asked

    4 months ago


    1 answers

    0

    Just local s: felt* should work. I guess you'll need to use something like ids.s = s memory[s] = whatever

    answered

    4 months ago

    Your answer

    NEWTON

    NEWTON