[CM] How to iterate through a hash-table in C?

Iain Duncan iainduncanlists at gmail.com
Tue Dec 8 13:18:18 PST 2020


Thanks Bill. So for creating a new hash-table, is there anything wrong with
doing the following, given that the call to max_atom_to_s7_obj is recursive
and could be making objects for a long time, if the Max dict is very deep:

    // turn off the GC in case the object tree we are making is very big
    s7_gc_on(s7, false);
    // max_atom_to_s7_obj will recurse for nested dicts and arrays, top
level will be a hash-table
    s7_value = max_atom_to_s7_obj(s7, ap);
    s7_gc_on(s7, true);

thanks again!
iain


On Tue, Dec 8, 2020 at 11:48 AM <bil at ccrma.stanford.edu> wrote:

> > So in the case of creating a new hash-table, I guess it will not be
> > protected?
>
> That is correct.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20201208/48108b1e/attachment.html>


More information about the Cmdist mailing list