Items tagged with cache cache Tagged Items Feed

Call EvalMapleStatement from c dll.

expression always has form like "F(0.4, 0.7, 0.9);" i.e. maple defined function called. All i need it's value without any kind of caching. But memory usage dramatically grows. Help to overcome it!

 

Tried already EvalMapleStatement ("forget(F);") - do not work. I'm out of ideas what maple also caches. F itself is complicated enought. And not known a priori. How to clear all caches of other functions that f might call?

Consider the following C code:

It looks like `forget` works on procedures with option 'cache'.

I realize that there is a routine Cache:-RemovePermanent. But should `forget` be clearing the permanent Cache entries for a procedure?

> cacheFunc := proc() option cache; print(args); args; end proc:
> Cache:-AddPermanent( cacheFunc, [5], 10 );
> op( 4, eval(cacheFunc) );
                      Cache(512, 'permanent' = [5 = 10])
 
> forget(cacheFunc);
> op( 4, eval(cacheFunc) ); # NULL return, it's empty
Page 1 of 1