On 07/09/2017 18:04, Simon King wrote:
Hi Dima,

On 2017-09-07, Dima Pasechnik <dimp...@gmail.com> wrote:
I don't think anything special like libgap_enter/exit  is needed when
calling libgap.* stuff from
Python or Cython.

The documentation in sage.libs.gap.libgap says:
"""
In particular, you must call ``libgap_mark_stack_bottom()`` in every
function that calls into the libGAP C functions. The reason is that
the GAP memory manager will automatically keep objects alive that are
referenced in local (stack-allocated) variables.
...
In order to
catch this error, it is recommended that you wrap calls into libGAP in
``libgap_enter`` / ``libgap_exit`` blocks and not call
``libgap_mark_stack_bottom`` manually.
"""

Or perhaps I misunderstood. After reading it again, I shouldn't have
expected a crash but should have checked for memory leaks.

I believe that GAP should also be initialized before calling any non-trivial function using the stack. How do you initalize it? (the call "import sage.libs.gap.libgap should do the job).

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to