@Conrad Meyer. Glib . Glib . . .
, . Valgrind :
==20350== HEAP SUMMARY:
==20350== in use at exit: 4,632 bytes in 12 blocks
==20350== total heap usage: 12 allocs, 0 frees, 4,632 bytes allocated
==20350==
==20350== LEAK SUMMARY:
==20350== definitely lost: 0 bytes in 0 blocks
==20350== indirectly lost: 0 bytes in 0 blocks
==20350== possibly lost: 992 bytes in 4 blocks
==20350== still reachable: 3,640 bytes in 8 blocks
==20350== suppressed: 0 bytes in 0 blocks
, :
#include <stdio.h>
#include <glib.h>
int main(int argc, char** argv) {
GList* list = NULL;
list = g_list_append(list, "Hello world!");
printf("The first item is '%s'\n", (char *)g_list_first(list)->data);
g_list_free(list);
return 0;
}
Valgrind:
==20310== HEAP SUMMARY:
==20310== in use at exit: 4,632 bytes in 12 blocks
==20310== total heap usage: 12 allocs, 0 frees, 4,632 bytes allocated
==20310==
==20310== LEAK SUMMARY:
==20310== definitely lost: 0 bytes in 0 blocks
==20310== indirectly lost: 0 bytes in 0 blocks
==20310== possibly lost: 0 bytes in 0 blocks
==20310== still reachable: 4,632 bytes in 12 blocks
==20310== suppressed: 0 bytes in 0 blocks
, still reachable .