ddn.util.monaco.safe
Types 3
structProcessInfoNoGC
Process information structure for @nogc environments.
This struct uses fixed-size buffers instead of dynamic arrays to avoid garbage collector allocations. It's suitable for real-time systems and environments where GC pauses are unacceptable.
Example:
auto info = processInfoNoGC(getpid());
import std.string : fromStringz;
writeln("Process: ", fromStringz(info.name.ptr));Methods
structPidsBuffer
Buffer for storing process IDs without GC allocation.
This struct provides a fixed-size buffer for storing process IDs, suitable for @nogc environments.
Example:
auto buffer = pidsNoGC();
writeln("Found ", buffer.count, " processes");
for (size_t i = 0; i < buffer.count; i++) {
writeln("PID: ", buffer.pids[i]);
}Fields
int[4096] pidssize_t countMethods
structProcessBuffer
Pre-allocated buffer for storing process information.
This struct provides a fixed-size buffer for storing process information without requiring garbage collector allocation. Suitable for real-time systems and high-frequency monitoring.
Example:
ProcessBuffer buffer;
fillProcessBuffer(buffer);
writeln("Found ", buffer.count, " processes");Methods
Functions 5
private fn
void readCommFile(const char * path, ref char[256] nameBuffer) @nogc @trusted nothrowReads process name from /proc/<pid>/comm file.fn
ProcessInfoNoGC processInfoNoGC(int pid) @nogc @safeGets process information without GC allocation.fn
void fillProcessBuffer(ref ProcessBuffer buffer) @nogc @safeFills a pre-allocated buffer with process information.