Пример #1
0
			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;
			}
Пример #2
0
			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;
			}
Пример #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();
        }
Пример #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;
        }
    }
Пример #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;
        }
    }
Пример #6
0
			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;
				}
			}
Пример #7
0
			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;
				}
			}
Пример #8
0
 public static extern int lua_gc(LuaState L, GC what, int data);
Пример #9
0
 public void Dispose()
 {
     Dispose(isDisposing: true);
     GC.SuppressFinalize(this);
 }
Пример #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
			}
		}