Subject: [SWIPL] Querying PL from C, under Freebsd.

From: Yan Guiborat <[email-masked]>
Date: Thu, 31 Jan 2002 10:33:08 GMT+1

Hi,

I am facing a problem that I really don't know how to solve 
fast, may be one could help, it would be great thanks.
I was calling PL from C, under freeBSD in a usual way 
looking like this.

term_t a0;
predicate_t p;
qid_t q;

a0 = PL_new_term_ref();
.....
....

when I tested my application, it stucks, and if I don't 
stop it fast enougth, it makes my pager process complain 
strongly, and them kill the app and core it.
I found that the problem was coming from the term 
allocation ( a0 = PL_new_term_ref() ), and when I checked 
in SwiPL doc, I found this :
"
term_t PL_new_term_ref()
Return a fresh reference to a term. The reference is 
allocated on the local stack. Allocating a term-reference 
may trigger a stack-shift on machines that cannot use 
sparse-memory management for allocation the Prolog stacks. 
The returned reference describes a variable. 
"
I though so that my freebsd (4.0) cannot use sparse memory 
management...is there a way to solve this problem, or do I 
have to implement a sparse memory management or forget 
about working under BSD (very sad).

To any future help, thanks.
Yan.
_________________________________________________________
Le journal des abonnés Caramail - http://www.carazine.com