Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use a smaller value to ensure that at least for DEBUG builds
we test the code path that rents a bigger array from ArrayPool
  • Loading branch information
adamsitnik committed Feb 25, 2021
commit 969b96bd616e14ab6de04b96d175b4240bbb8b18
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ private static ProcessModuleCollection GetModules(int processId, bool firstModul

var modules = new ProcessModuleCollection(firstModuleOnly ? 1 : modulesCount);

#if RELEASE
int minimumLength = Interop.Kernel32.MAX_PATH;
#else
// use a smaller value to ensure that at least for DEBUG builds
// we test the code path that rents a bigger array from ArrayPool
int minimumLength = Interop.Kernel32.MAX_PATH / 4;
#endif
char[]? chars = ArrayPool<char>.Shared.Rent(minimumLength);
try
{
Expand Down