Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Smob documentation




Hi,

could someone please add a section to data-rep.texi
that describes how and why it is neccesary to inhibit
garbage collection while creating a smob.  It took
me one hour to find the following bug:



[...]

  scm_block_gc = 1; /* prevent memoized from being gc'ed */
  {
    eval_environment->memoized = 
      scm_make_doubly_weak_hash_table((SCM) SCM_MAKINUM (scm_symhash_dim));

    eval_environment_smob = scm_make_environment(eval_environment);
  }
  scm_block_gc = 0;

  return eval_environment_smob;

[...]



Jost

Guile Home | Main Index | Thread Index