Am 29.07.25 um 11:44 schrieb Lukas Wagner: >> +// A 4k buffer should be plenty to temporarily store RRD data. 64 bit >> integers are 20 chars long, >> +// plus the separator char: (4096-1)/21~195 columns This buffer is only >> used in the >> +// `update_rrd_data` function. It is safe to use as the calling sites get >> the global mutex: >> +// rrd_update_data -> rrdentry_hash_set -> cfs_status_set / and >> cfs_kvstore_node_set >> +static char rrd_format_update_buffer[4096]; > Maybe I'm missing something, but since this is only used in the > update_rrd_data function, is there any reason why this statically > allocated and not just malloc'd as needed?
For the record: I nudged Aaron in that direction in a previous review, IMO a small static buffer can sometimes be easier to handle compared to malloc, and definitively could be more performant that frequent malloc+free sequences, but performance probably is not really impacted here in any case. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel