PMFREEEVENTRESULT(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMFREEEVENTRESULT πŸ’–

okay bestie, so this is pmFreeHighResEventResult and pmFreeEventResult from the PCP library functions manual β€” they're the cleanup crew, the little guys who come in after the party and release the storage that got allocated for unpacked event records. very demure, very mindful, extremely necessary. 🧹✨


🌸 NAME 🌸

pmFreeHighResEventResult, pmFreeEventResult β€” release storage allocated for unpacked event records πŸ’…


✨ C SYNOPSIS ✨

#include <pcp/pmapi.h>

void pmFreeHighResEventResult(pmResult **hrset);
void pmFreeEventResult(pmResult_v2 **rset);

cc ... -lpcp

like yes, that's the whole vibe. two functions, one header, one link flag, no notes. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you're processing event records, right? and you use pmUnpackHighResEventRecords(3) to unpack event records from a metric inside a pmResult structure where the value is of type PM_TYPE_HIGHRES_EVENT. the structure that comes back from pmUnpackHighResEventRecords(3) is a NULL pointer terminated array of pointers to pmResult structures, one for each event record. iconic data layout honestly. πŸ‘‘

pmFreeHighResEventResult is the convenience method β€” the bestie who handles it for you β€” and it frees all of the pmResult structures and the array of pointers (hrset). all of it. gone. clean. periodt. πŸ’–

similarly, pmFreeEventResult may be used to free the pmResult_v2 structures and array returned from the pmUnpackEventRecords routine when you're working with PM_TYPE_EVENT metrics. same energy, different struct. 🫢

no cap, if you unpack it, you gotta free it. that's the whole plot. πŸ’€

🌈 SEE ALSO 🌈


and that's the tea, bestie πŸ“ this lil page is part of the Performance Co-Pilot collection, aka PCP β€” go forth and free your event results responsibly. mwah. πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from