// Native memory tracking level // // The meaning of the different states: // // "unknown": pre-init phase (before parsing NMT arguments) // // "off": after initialization - NMT confirmed off. // - nothing is tracked // - no malloc headers are used // // "summary": after initialization with NativeMemoryTracking=summary - NMT in summary mode // - category summaries per tag are tracked // - thread stacks are tracked // - malloc headers are used // - malloc call site table is allocated and used // // "detail": after initialization with NativeMemoryTracking=detail - NMT in detail mode // - category summaries per tag are tracked // - malloc details per call site are tracked // - virtual memory mapping info is tracked // - thread stacks are tracked // - malloc headers are used // - malloc call site table is allocated and used //
// Number of stack frames to capture. This is a // build time decision. const int NMT_TrackingStackDepth = 4;
// A few common utilities for native memory tracking class NMTUtil : AllStatic { public: // Check if index is a valid MEMFLAGS enum value (including mtNone) static inline bool flag_index_is_valid(int index) { return index >= 0 && index < mt_number_of_types;
}
// Check if flag value is a valid MEMFLAGS enum value (including mtNone) static inline bool flag_is_valid(MEMFLAGS flag) { const int index = static_cast<int>(flag); return flag_index_is_valid(index);
}
// Map memory type to index static inline int flag_to_index(MEMFLAGS flag) {
assert(flag_is_valid(flag), "Invalid flag (%u)", (unsigned)flag); returnstatic_cast<int>(flag);
}
// Map memory type to human readable name staticconst char* flag_to_name(MEMFLAGS flag) { return _strings[flag_to_index(flag)].human_readable;
}
// Map an index to memory type static MEMFLAGS index_to_flag(int index) {
assert(flag_index_is_valid(index), "Invalid flag index (%d)", index); returnstatic_cast<MEMFLAGS>(index);
}
// Parses the tracking level from a string. Returns NMT_unknown if // string is not a valid level. static NMT_TrackingLevel parse_tracking_level(const char* s);
// Given a string, return associated flag. mtNone if name is invalid. // String can be either the human readable name or the // stringified enum (with or without leading "mt". In all cases, case is ignored. static MEMFLAGS string_to_flag(const char* name);
// Returns textual representation of a tracking level. staticconst char* tracking_level_to_string(NMT_TrackingLevel level);
private: struct S { const char* enum_s; // e.g. "mtNMT" const char* human_readable; // e.g. "Native Memory Tracking"
}; static S _strings[mt_number_of_types];
};
#endif// SHARE_SERVICES_NMTCOMMON_HPP
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet am 2026-09-04)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.