mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-27 20:01:15 -05:00
In order to be able to properly allocate all storage and retrieve data from there, we'll need to know how many thread groups are supposed to access it. Let's store the number of thread groups at init time. If the tgrp_step is zero, there's always only one tg though. Now EXTRA_COUNTERS_ALLOC() takes this number of thread groups in argument and stores it in the structure. It also allocates as many areas as needed, incrementing the datap pointer by the step for each of them. EXTRA_COUNTERS_FREE() uses this info to free all allocated areas. EXTRA_COUNTERS_INIT() initializes all allocated areas, this is used elsewhere to clear/preset counters, e.g. in proxy_stats_clear_counters(). It involves a memcpy() call for each array, which is normally preset to something empty but might also be used to preset certain non-scalar fields such as an instance name. |
||
|---|---|---|
| .. | ||
| haproxy | ||
| import | ||
| make | ||