-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Code Quality: Sync the jump list with Explorer #17564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
0x5bfa
wants to merge
10
commits into
files-community:main
Choose a base branch
from
0x5bfa:5bfa/CQ-JumpListManager
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,240
−368
Open
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d1890a2
Init
0x5bfa ea23b64
Use custom destinations instead
0x5bfa 4d669b9
Use proper folder icons
0x5bfa e3d143e
Open items in FIles
0x5bfa 7ed393f
Update
0x5bfa f9484fc
Fixed a memory leak
0x5bfa 9fcdd5b
Correct the execution path
0x5bfa 93b5b34
Reimplement & fix all issues
0x5bfa 155ae79
Add a folder viewed to the Recent category
0x5bfa 3dffacd
Req
0x5bfa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| // Copyright (c) Files Community | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| namespace Windows.Win32 | ||
| { | ||
| /// <summary> | ||
| /// Contains a heap pointer allocated via <see cref="NativeMemory.Alloc"/> and a set of methods to work with the pointer safely. | ||
| /// </summary> | ||
| public unsafe struct HeapPtr<T> : IDisposable where T : unmanaged | ||
| { | ||
| private T* _ptr; | ||
|
|
||
| public readonly bool IsNull | ||
| { | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| get => _ptr is null; | ||
| } | ||
|
|
||
| public HeapPtr(T* ptr) | ||
| { | ||
| _ptr = ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public readonly T* Get() | ||
| { | ||
| return _ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public readonly T** GetAddressOf() | ||
| { | ||
| return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public void Attach(T* ptr) | ||
| { | ||
| Dispose(); | ||
| _ptr = ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public T* Detach() | ||
| { | ||
| T* ptr = _ptr; | ||
| _ptr = null; | ||
| return ptr; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public bool Allocate(nuint cch) | ||
| { | ||
| _ptr = (T*)NativeMemory.Alloc(cch); // malloc() | ||
| return _ptr is not null; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public bool Reallocate(nuint cch) | ||
| { | ||
| T* ptr = (T*)NativeMemory.Realloc(_ptr, cch); // realloc() | ||
| if (ptr is null) return false; | ||
| _ptr = ptr; | ||
| return true; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public void Dispose() | ||
| { | ||
| T* ptr = _ptr; | ||
| if (ptr is null) return; | ||
| _ptr = null; | ||
| NativeMemory.Free(ptr); // free() | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.