fillProcessBuffer

fnvoid fillProcessBuffer(ref ProcessBuffer buffer) @nogc @safe

Fills a pre-allocated buffer with process information.

This function populates the buffer with information about all running processes, avoiding garbage collector allocation.

Parameters

bufferReference to ProcessBuffer to fill. Example:
ProcessBuffer buffer;
fillProcessBuffer(buffer);
writeln("Found ", buffer.count, " processes");
for (size_t i = 0; i < buffer.count; i++) {
  import std.string : fromStringz;
  writeln("  PID ", buffer.processes[i].pid, ": ",
          fromStringz(buffer.processes[i].name.ptr));
}