3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-11 13:40:52 +00:00

Beginnings of a Java API. This is under heavy construction.

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2012-11-22 20:38:05 +00:00
parent e37a347b33
commit 985145d810
36 changed files with 11224 additions and 11 deletions

View file

@ -0,0 +1,50 @@
/**
* This file was automatically generated from DecRefQUeue.cs
**/
package com.Microsoft.Z3;
/* using System; */
/* using System.Collections; */
/* using System.Collections.Generic; */
/* using System.Threading; */
abstract class DecRefQueue
private void ObjectInvariant()
readonly protected Object mLock = new Object();
readonly protected List<IntPtr> mQueue = new List<IntPtr>();
const Integer mMoveLimit = 1024;
public abstract void IncRef(Context ctx, IntPtr obj);
public abstract void DecRef(Context ctx, IntPtr obj);
public void IncAndClear(Context ctx, IntPtr o)
IncRef(ctx, o);
if (mQueue.Count >= mMoveLimit) Clear(ctx);
public void Add(IntPtr o)
if (o == IntPtr.Zero) return;
lock (mLock)
mQueue.Add(o);
public void Clear(Context ctx)
lock (mLock)
for (IntPtr.Iterator o = mQueue.iterator(); o.hasNext(); )
DecRef(ctx, o);
mQueue.Clear();
abstract class DecRefQueueContracts : DecRefQueue
public void IncRef(Context ctx, IntPtr obj)
public void DecRef(Context ctx, IntPtr obj)