名前...
Move to
Next Prev
Up Top
See also
ProOpen, ProFetch, ProClose
Protect, UnProtect
IF Computer > IF/Prolog > Manuals > IF/Prolog V4.1 マニュアル > IF/Prolog Interfaces > IF/PrologからC言語へのインタフェ−ス > 低レベルのインタフェイス > Protect, UnProtect

Protect, UnProtect

MINERVA superseeded IF/Prolog. Please see http://www.ifcomputer.co.jp/MINERVA for details.

We discontinued to sell IF/Prolog Dec 31. 2003. Dedicated technical support for IF/Prolog ended Dec 31 2008. This site is maintained as a community service only.

名前

Protect UnProtect

概要 Protect(Term_Ptr) UnProtect(Term_Ptr)

Term *Term_Ptr;

IF/Prologのカーベジ・コレクタが動いていて、しかもPrologの項のための領域がC側で確保されている時に、CからPrologの述語を呼び出すと問題を起こすことがあります。この問題を避けるために、C側で用意した項をカーベジ・コレクタに知らせてやらなければなりませんが、そのためにはProtect()を使います。Unprotect()は、項の値を0にすることで、その項を後で使えないように無効にし、またカーベジ・コレクタによって自動的に処理されることがないようにします。

使用例:

example() { TERM t;

t = Arg(1); Protect(&t);

ProOpen( .. ); ProFetch( .. ); ProClose( .. );

printt("%q\n",t); UnProtect(&t); return 1; }

Cboot() { CPRIM("example",1,example); }

read on...
IF/Prolog by Siemens
Language
English
Japanese
German
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/IFProlog/Manuals/v4.1/advanced_feature/c_interface/lowli/proun/home_en.html
published 2012/5/21 update 1995/11/6 (c) 1996-2009 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS