From bsimmons@csd.uwo.ca Mon Jul 23 22:57:43 2001
Received: from chaplin.csd.uwo.ca (chaplin.csd.uwo.ca [129.100.10.252])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f6NKvgJ07221
	for <prolog@swi.psy.uva.nl>; Mon, 23 Jul 2001 22:57:42 +0200 (MET DST)
Date: Mon, 23 Jul 2001 16:57:39 -0400 (EDT)
From: Brad Simmons <bsimmons@csd.uwo.ca>
To: prolog@swi.psy.uva.nl
Subject: [SWIPL] memory management when calling from C
Message-ID: <Pine.SOL.3.96.1010723164157.24332A-100000@brown.csd.uwo.ca>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello.

I am currently calling prolog from C.

-------------------------------------------------------------
term_t MSS, t_2, NMs, Error, line_no;	
int i, i1;
i = 0;
i1 = 0;

while(i < 100)
{
	MSS = PL_new_term_refs(5);
	t_2 = MSS+1;		 
	NMs = MSS+2;
	Error = MSS+3;
	line_no = MSS+4;
	....

	i1 = PL_call_predicate(NULL, PL_Q_NORMAL, RE_pred, MSS);
	i++;


}
----------------------------------------------------------------

what is the effect on prolog's memory management.
What happens to the data that was previously refered to by MSS?
Does the data no longer refered to in C stay on the prolog stack?

Any help would be great.

If the non-referenced data persists - how would I remove it while using
the term_t NMs that is solved for in the query?

PS - please cc any response to->  bsimmons@csd.uwo.ca

Thanks.


  


