public void UnlinkHeapFromAvailable(GC.GCHeap* pHeap)
			{
				if (pHeap->AllocatorPrev == null) AvailableFirst = pHeap->AllocatorNext;
				else pHeap->AllocatorPrev->AllocatorNext = pHeap->AllocatorNext;
				if (pHeap->AllocatorNext == null) AvailableLast = pHeap->AllocatorPrev;
				else pHeap->AllocatorNext->AllocatorPrev = pHeap->AllocatorPrev;
			}
			public void UnlinkHeapFromAllocated(GC.GCHeap* pHeap)
			{
				if (pHeap->AllocatorPrev == null) AllocatedFirst = pHeap->AllocatorNext;
				else pHeap->AllocatorPrev->AllocatorNext = pHeap->AllocatorNext;
				if (pHeap->AllocatorNext == null) AllocatedLast = pHeap->AllocatorPrev;
				else pHeap->AllocatorNext->AllocatorPrev = pHeap->AllocatorPrev;
			}
Exemple #3
0
        private void ConfigureDlg()
        {
            var filterFrom = new RouteListsFilter(UoW);

            filterFrom.SetAndRefilterAtOnce(
                f => f.OnlyStatuses = new[] {
                RouteListStatus.EnRoute,
                RouteListStatus.OnClosing
            },
                f => f.SetFilterDates(
                    DateTime.Today.AddDays(-3),
                    DateTime.Today.AddDays(1)
                    )
                );
            var vmFrom = new RouteListsVM(filterFrom);

            GC.KeepAlive(vmFrom);
            yentryreferenceRLFrom.RepresentationModel = vmFrom;
            yentryreferenceRLFrom.JournalButtons      = QS.Project.Dialogs.GtkUI.Buttons.Add | QS.Project.Dialogs.GtkUI.Buttons.Edit;
            yentryreferenceRLFrom.CanEditReference    = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_delete");

            var filterTo = new RouteListsFilter(UoW);

            filterTo.SetAndRefilterAtOnce(
                f => f.OnlyStatuses = new[] {
                RouteListStatus.New,
                RouteListStatus.InLoading,
                RouteListStatus.EnRoute,
                RouteListStatus.OnClosing
            },
                f => f.SetFilterDates(
                    DateTime.Today.AddDays(-3),
                    DateTime.Today.AddDays(1)
                    )
                );
            var vmTo = new RouteListsVM(filterTo);

            yentryreferenceRLTo.RepresentationModel = vmTo;
            yentryreferenceRLTo.JournalButtons      = QS.Project.Dialogs.GtkUI.Buttons.Add | QS.Project.Dialogs.GtkUI.Buttons.Edit;
            yentryreferenceRLTo.CanEditReference    = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_delete");

            yentryreferenceRLFrom.Changed += YentryreferenceRLFrom_Changed;
            yentryreferenceRLTo.Changed   += YentryreferenceRLTo_Changed;

            //Для каждой TreeView нужен свой экземпляр ColumnsConfig
            ytreeviewRLFrom.ColumnsConfig = GetColumnsConfig(false);
            ytreeviewRLTo.ColumnsConfig   = GetColumnsConfig(true);

            ytreeviewRLFrom.Selection.Mode = Gtk.SelectionMode.Multiple;
            ytreeviewRLTo.Selection.Mode   = Gtk.SelectionMode.Multiple;

            ytreeviewRLFrom.Selection.Changed += YtreeviewRLFrom_OnSelectionChanged;
            ytreeviewRLTo.Selection.Changed   += YtreeviewRLTo_OnSelectionChanged;

            ConfigureTreeViewsDriverBalance();

            ybtnTransferTerminal.Clicked += (sender, e) => TransferTerminal.Execute();
            ybtnRevertTerminal.Clicked   += (sender, e) => RevertTerminal.Execute();
        }
Exemple #4
0
    /// <summary>
    /// Initializes a new instance of the <see cref="TransferBufferDebugView{T}"/> class with the specified parameters.
    /// </summary>
    /// <param name="buffer">The input <see cref="TransferBuffer{T}"/> instance with the items to display.</param>
    public TransferBufferDebugView(TransferBuffer <T>?buffer)
    {
        if (buffer is not null)
        {
            T[] items = GC.AllocateUninitializedArray <T>(buffer.Length);

            buffer.Span.CopyTo(items);

            Items = items;
        }
    }
Exemple #5
0
    /// <summary>
    /// Initializes a new instance of the <see cref="BufferDebugView{T}"/> class with the specified parameters.
    /// </summary>
    /// <param name="buffer">The input <see cref="Buffer{T}"/> instance with the items to display.</param>
    public BufferDebugView(Buffer <T>?buffer)
    {
        if (buffer is not null)
        {
            T[] items = GC.AllocateUninitializedArray <T>(buffer.Length);

            buffer.CopyTo(ref items[0], 0, buffer.Length);

            Items = items;
        }
    }
			public void LinkHeapToAvailable(GC.GCHeap* pHeap)
			{
				if (AvailableLast == null)
				{
					pHeap->AllocatorPrev = null;
					pHeap->AllocatorNext = null;
					AvailableFirst = pHeap;
					AvailableLast = pHeap;
				}
				else
				{
					AvailableLast->AllocatorNext = pHeap;
					pHeap->AllocatorPrev = AvailableLast;
					pHeap->AllocatorNext = null;
					AvailableLast = pHeap;
				}
			}
			public void LinkHeapToAllocated(GC.GCHeap* pHeap)
			{
				if (AllocatedLast == null)
				{
					pHeap->AllocatorPrev = null;
					pHeap->AllocatorNext = null;
					AllocatedFirst = pHeap;
					AllocatedLast = pHeap;
				}
				else
				{
					AllocatedLast->AllocatorNext = pHeap;
					pHeap->AllocatorPrev = AllocatedLast;
					pHeap->AllocatorNext = null;
					AllocatedLast = pHeap;
				}
			}
Exemple #8
0
 public static extern int lua_gc(LuaState L, GC what, int data);
Exemple #9
0
 public void Dispose()
 {
     Dispose(isDisposing: true);
     GC.SuppressFinalize(this);
 }
Exemple #10
0
		internal static void DeallocateHeap(GC.GCHeap* pHeap)
		{
			// TODO: Make thread-safe
			PageAllocator.Deallocate((ulong)pHeap->Heap, pHeap->HeapSize);
			pHeap->HeapSize = 0;
			pHeap->Heap = null;
			if (pHeap->Tree != null)
			{
				PageAllocator.Deallocate((ulong)pHeap->Tree, pHeap->TreeSize);
				pHeap->TreeSize = 0;
				pHeap->Tree = null;
				pHeap->TreeLevels = 0;
			}
			pHeap->AllocatedFirst = null;
			pHeap->AllocatedLast = null;
			pHeap->PageOfHeaps->UnlinkHeapFromAllocated(pHeap);
			pHeap->PageOfHeaps->LinkHeapToAvailable(pHeap);
			if (pHeap->AllocatedFirst == null)
			{
				// TODO: Threshold for DeallocatePageOfHeaps
			}
		}