#include "PerfMonEvent/mallinfo.h"
#include "CxxUtils/checker_macros.h"
#include <sys/time.h>
#include <fcntl.h>
#include <ctime>
#include <cassert>
#include <cstring>
#include <climits>
#include <limits>
#include <sstream>
#include <string>
#include <map>
#include <unordered_map>
#include <cmath>
#include <cstdlib>
#include <dlfcn.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
Go to the source code of this file.
◆ ATLAS_NOT_THREAD_SAFE()
double PMonSD::get_malloc_kb ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
|
inline |
Install fatal handler with default options.
This is meant to be easy to call from python via ctypes.
Definition at line 474 of file SemiDetMisc.h.
486 int64_t uordblks_raw =
m.uordblks;
487 if (
sizeof(
m.uordblks)==
sizeof(int32_t)) {
490 static int64_t last_uordblks=
m.uordblks;
491 static int64_t offset_uordblks=0;
492 if (uordblks_raw-last_uordblks>half_range) {
494 offset_uordblks-=2*half_range;
495 }
else if (last_uordblks-uordblks_raw>half_range) {
497 offset_uordblks+=2*half_range;
499 last_uordblks=uordblks_raw;
500 uordblks_raw+=offset_uordblks;
503 int64_t hblkhd_raw =
m.hblkhd;
504 if (
sizeof(
m.hblkhd)==
sizeof(int32_t)) {
507 static int64_t last_hblkhd=
m.hblkhd;
508 static int64_t offset_hblkhd=0;
509 if (hblkhd_raw-last_hblkhd>half_range) {
511 offset_hblkhd-=2*half_range;
512 }
else if (last_hblkhd-hblkhd_raw>half_range) {
514 offset_hblkhd+=2*half_range;
516 last_hblkhd=hblkhd_raw;
517 hblkhd_raw+=offset_hblkhd;
519 return (uordblks_raw+hblkhd_raw)/1024.0;