callable library

Questions and problems about using polymake go here.
nkriha
Posts: 5
Joined: 26 Nov 2011, 21:59

callable library

Postby nkriha » 10 Jan 2012, 10:41

From reading the documentation for c++ clients I got the impression that assignment would work automagicaly with the reference counting behind the scenes. So it was somewhat surprising to see this eat up memory rather fast.

Code: Select all

polymake::Main m; m.set_application("polytope"); pm::perl::Scope s = m.newScope(); pm::perl::Object p; while(1){ CallPolymakeFunction("rand_sphere", 20, 200) >> p; }
Shouldn't the memory for the old polytope be freed each loop iteration or am I misusing perl::Objects here?


I have another totally unrelated question. How can I use the return value of a script from the callable library? I tried

Code: Select all

CallPolymakeFunction("script", "/pathtoscript/simple.pl") >> p;
with a trivial script like

Code: Select all

use application "polytope"; cube(3);
but accessing any of p's attributes will result in a "Can't call method "type" on an undefined value" exception at runtime.

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: callable library

Postby gawrilow » 10 Jan 2012, 12:20

Looks like bugs, especially the second one. Could you please create Trac tickets?


Return to “Helpdesk”