cpuinfo icon indicating copy to clipboard operation
cpuinfo copied to clipboard

Free resources in cpuinfo_deinitialize

Open prashanthswami opened this issue 1 year ago • 1 comments

Users of the library can choose to release all resources the library may have allocated as part of a previous cpuinfo_initialize call. If no resources were previously allocated, this function does nothing.

Callers cannot re-initialize after the cpuinfo_deintialize call, as the library assumes initialization is a one-time operation per-process. Further, de-initializing can invalidate pointers previously acquired from cpuinfo (e.g. structures returned from cpuinfo_get_current_processor).

As such, callers should only call cpuinfo_deinitialize when:

  1. There are no further uses of references returned from cpuinfo.
  2. There are no further calls to cpuinfo_* functions.

Fixes #150

prashanthswami avatar Nov 29 '23 22:11 prashanthswami