Example #1
0
 /*
 ** Change the alarm callback
 */
 static int sqlite3MemoryAlarm(
     dxalarmCallback xCallback, //void(*xCallback)(void pArg, sqlite3_int64 used,int N),
     object pArg,
   sqlite3_int64 iThreshold
 )
 {
   sqlite3_mutex_enter( mem0.mutex );
   mem0.alarmCallback = xCallback;
   mem0.alarmArg = pArg;
   mem0.alarmThreshold = iThreshold;
   sqlite3_mutex_leave( mem0.mutex );
   return SQLITE_OK;
 }
Example #2
0
 public Mem0Global( int nScratchFree, int nPageFree, sqlite3_mutex mutex, sqlite3_int64 alarmThreshold, dxalarmCallback alarmCallback, object alarmArg, int Byte_Allocation, int Int_Allocation, int Mem_Allocation, int BtCursor_Allocation )
 {
   this.nScratchFree = nScratchFree;
   this.nPageFree = nPageFree;
   this.mutex = mutex;
   this.alarmThreshold = alarmThreshold;
   this.alarmCallback = alarmCallback;
   this.alarmArg = alarmArg;
   this.msByte.next = -1;
   this.msInt.next = -1;
   this.msMem.next = -1;
   this.aByteSize = new int[] { 32, 256, 1024, 8192, 0 };
   this.aByte_used = new int[] { -1, -1, -1, -1, -1 };
   this.aByte = new byte[this.aByteSize.Length][][];
   for ( int i = 0; i < this.aByteSize.Length; i++ ) this.aByte[i] = new byte[Byte_Allocation][];
   this.aInt = new int[Int_Allocation][];
   this.aMem = new Mem[Mem_Allocation <= 4 ? 4 : Mem_Allocation];
   this.aBtCursor = new BtCursor[BtCursor_Allocation <= 4 ? 4 : BtCursor_Allocation];
 }
Example #3
0
    /*
** Deprecated external interface.  Internal/core SQLite code
** should call sqlite3MemoryAlarm.
*/
    static int sqlite3_memory_alarm(
    dxalarmCallback xCallback, //void(*xCallback)(void *pArg, sqlite3_int64 used,int N),
    object pArg,
    sqlite3_int64 iThreshold
    )
    {
      return sqlite3MemoryAlarm( xCallback, pArg, iThreshold );
    }
Example #4
0
			public Mem0Global(int nScratchFree, int nPageFree, sqlite3_mutex mutex, sqlite3_int64 alarmThreshold, dxalarmCallback alarmCallback, object alarmArg, int Byte_Allocation, int Int_Allocation, int Mem_Allocation, int BtCursor_Allocation)
			{
				this.nScratchFree = nScratchFree;
				this.nPageFree = nPageFree;
				this.mutex = mutex;
				this.alarmThreshold = alarmThreshold;
				this.alarmCallback = alarmCallback;
				this.alarmArg = alarmArg;
				this.msByte.next = -1;
				this.msInt.next = -1;
				this.msMem.next = -1;
				this.aByteSize = new int[] { 32, 256, 1024, 8192, 0 };
				this.aByte_used = new int[] { -1, -1, -1, -1, -1 };
				this.aByte = new byte[this.aByteSize.Length][][];
				for (int i = 0; i < this.aByteSize.Length; i++)
					this.aByte[i] = new byte[Byte_Allocation][];
				this.aInt = new int[Int_Allocation][];
				this.aMem = new Mem[Mem_Allocation <= 4 ? 4 : Mem_Allocation];
				this.aBtCursor = new BtCursor[BtCursor_Allocation <= 4 ? 4 : BtCursor_Allocation];
				this.nearlyFull = false;
			}
Example #5
0
 public Mem0Global( int nScratchFree, int nPageFree, sqlite3_mutex mutex, sqlite3_int64 alarmThreshold, dxalarmCallback alarmCallback, object alarmArg, int alarmBusy, int[] aScratchFree, int[] aPageFree )
 {
   this.nScratchFree = nScratchFree;
   this.nPageFree = nPageFree;
   this.mutex = mutex;
   this.alarmThreshold = alarmThreshold;
   this.alarmCallback = alarmCallback;
   this.alarmArg = alarmArg;
   this.alarmBusy = alarmBusy;
   this.aScratchFree = aScratchFree;
   this.aPageFree = aPageFree;
 }