tst610.mal
来自「一个内存数据库的源代码这是服务器端还有客户端」· MAL 代码 · 共 49 行
MAL
49 行
#this test is used to monitor reference count setting#create a persistent bat and destroy it in test 612function refs():void; g:=bbp.getNames(); gr:=bbp.getRefCount(); gl:=bbp.getLRefCount(); io.print(g,gr,gl);end refs;b:= bat.new(:int,:int);#refs();bat.insert(b,23,32);#refs();bat.setName(b,"tasks");#refs();bat.setPersistent(b,true);#refs();# it is committed io.print("open box");bbp.open();user.refs();t:bat[:any_1,:any_2]:= bbp.bind("tasks");io.print(t);bbp.release(t);user.refs();io.print(t);catch MALException:str;io.print("BAT was released");exit MALException;# the bat is still visible, because the destroy only# marks it for deletion at the end of session or# when the reference counters drop to zerot:bat[:any_1,:any_2]:= bbp.bind("tasks");user.refs();# to really remove, we get rid of the current# references as wellbbp.destroy(t,true);user.refs();io.print(t);catch MALException:str;io.print("BAT was destroyed");exit MALException;z:bat[:any_1,:any_2]:= bbp.bind("tasks");io.print(z);#it is not in the box anymore eithercatch MALException:str;io.print("BAT was removed from the box");exit MALException;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?