16 lines
470 B
C
16 lines
470 B
C
|
|
#ifndef HAKMEM_SIZE_HIST_H
|
||
|
|
#define HAKMEM_SIZE_HIST_H
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
#include <stddef.h>
|
||
|
|
|
||
|
|
// Lightweight size histogram (1 KiB bins) with sampling.
|
||
|
|
// Range: 1 KiB .. 2048 KiB (2048 bins). Bin 0 is unused.
|
||
|
|
|
||
|
|
void hkm_size_hist_init(void);
|
||
|
|
void hkm_size_hist_record(size_t size);
|
||
|
|
// Copy up to n bins (bins[0..n-1] => sizes 0..(n-1) KiB). If reset!=0, zero after snapshot.
|
||
|
|
void hkm_size_hist_snapshot(uint64_t* bins, int n, int reset);
|
||
|
|
|
||
|
|
#endif // HAKMEM_SIZE_HIST_H
|