protected override void FreeReservation(long size) { if (size < 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ArgumentOutOfRange("size")); } lock (this.recordSequence.LogStore.SyncRoot) { SafeMarshalContext context = this.recordSequence.InternalMarshalContext; if (context == null || context.IsInvalid) { return; } // Reservation coming from collection, add record header // size. // size += LogLogRecordHeader.Size; long aligned; UnsafeNativeMethods.AlignReservedLogSingle( context, size, out aligned); // Adjustment must be negative, otherwise it's considered // a "set". (Yuck.) // aligned = -aligned; UnsafeNativeMethods.FreeReservedLog( context, 1, ref aligned); } }
protected override void MakeReservation(long size) { if (size < 0) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.ArgumentOutOfRange("size")); } // Reservation coming from collection, add record header // size. // size += LogLogRecordHeader.Size; long aligned; UnsafeNativeMethods.AlignReservedLogSingle( this.recordSequence.MarshalContext, size, out aligned); UnsafeNativeMethods.AllocReservedLog( this.recordSequence.MarshalContext, 1, ref aligned); }