MAT_VARFREE(3)
β¨ MAT_VARFREE β¨
okay bestie, gather round, because this is the MAT_VARFREE(3) page from the Library Functions Manual and she is lowkey a cleanup queen π
π NAME π
Mat_VarFree β frees a MAT variable structure. that's it. that's the job. she takes the whole variable and sends it to the void π«Ά
πΈ SYNOPSIS πΈ
#include <matio.h>
void
Mat_VarFree(matvar_t *matvar);
like yes, that's the whole vibe. one include, one function, one pointer. iconic π
π¦ DESCRIPTION π¦
so the way that Mat_VarFree() works is: it frees the memory that a MAT variable structure is using. she's the friend who actually returns the borrowed hoodie β except the hoodie is memory and the returning is freeing π§
and here's the part you need to actually remember, no cap: if the variable was not created with the MAT_F_DONT_COPY_DATA flag, the variable data is also free'd. so it's not just the structure getting yeeted, it's the data living inside it too. if you made it with MAT_F_DONT_COPY_DATA, the data is not yours to free, so she leaves it alone. respect the flag, bestie π
β οΈ fr fr, mind that flag. MAT_F_DONT_COPY_DATA means the data isn't owned by the variable, so it does not get free'd here. everything else does. don't be out here double-freeing like it's a personality trait π
π SEE ALSO π
the cute sign-off π
this page comes to you courtesy of Debian, dated March 18, 2012 β so she's been freeing variables since before some of us could even read. periodt. β¨π
π¦ where this page comes from
- arch rolling: libmatio 1.5.30-1 Β· BSD-2-Clause
- fedora 44: matio-devel 1.5.30-2.fc44 Β· BSD-2-Clause
- fedora 44: matio-devel 1.5.30-2.fc44 Β· BSD-2-Clause
- nixpkgs unstable: matio 1.5.30
- ubuntu resolute: libmatio-doc 1.5.30-2 Β· BSD-2-Clause
- ubuntu stonking: libmatio-doc 1.5.30-4build1 Β· BSD-2-Clause
- Copyright (c) 2015-2026, The matio contributors
- Copyright (c) 2012-2014, Christopher C. Hulbert
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms