Test that all resource are properly released.
Resourceusage | Test that all resource are properly released. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file of Resourceusage. |
C-kern/ | Implementation file Resourceusage impl. |
Types | |
struct resourceusage_t | Exports resourceusage_t. |
Functions | |
test | |
unittest_test_resourceusage | Unittest for query usage & releasing all resources. |
resourceusage_t | Stores the number of resources currently in use. |
file_usage | Number of open files. |
mmtrans_usage | Number of memory bytes allocated by mm_impl_t. |
mmtrans_correction | Number of bytes resourceusage_t uses itself. |
malloc_usage | Number of memory bytes allocated by malloc. |
malloc_correction | Number of bytes resourceusage_t uses itself. |
pagecache_usage | Sum of size of all cache memory pages. |
pagecache_correction | Size of pages resourceusage_t uses itself. |
pagecache_staticusage | Size of static memory allocated in pagecache_t. |
signalstate | Stores configuration state of signal subsystem. |
virtualmemory_usage | Layout of virtual memory. |
malloc_acceptleak | Holds maximum number of bytes of accepted malloc memory leak. |
lifetime | |
resourceusage_FREE | Static initializer. |
init_resourceusage | Stores the number of resources currently in use. |
free_resourceusage | Frees any memory which may be used to store the usage information. |
query | |
same_resourceusage | Returns 0 if the numbers of resources equals the numbers stored in usage. |
update | |
inline implementation | |
resourceusage_t | |
acceptmallocleak_resourceusage | Implements <resourceusage_t.acceptmallocleak_resourceusage>. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2011 Jörg Seebohn
Header file of Resourceusage.
Implementation file Resourceusage impl.
typedef struct resourceusage_t resourceusage_t
Exports resourceusage_t.
test | |
unittest_test_resourceusage | Unittest for query usage & releasing all resources. |
struct resourceusage_t
Stores the number of resources currently in use.
file_usage | Number of open files. |
mmtrans_usage | Number of memory bytes allocated by mm_impl_t. |
mmtrans_correction | Number of bytes resourceusage_t uses itself. |
malloc_usage | Number of memory bytes allocated by malloc. |
malloc_correction | Number of bytes resourceusage_t uses itself. |
pagecache_usage | Sum of size of all cache memory pages. |
pagecache_correction | Size of pages resourceusage_t uses itself. |
pagecache_staticusage | Size of static memory allocated in pagecache_t. |
signalstate | Stores configuration state of signal subsystem. |
virtualmemory_usage | Layout of virtual memory. |
malloc_acceptleak | Holds maximum number of bytes of accepted malloc memory leak. |
lifetime | |
resourceusage_FREE | Static initializer. |
init_resourceusage | Stores the number of resources currently in use. |
free_resourceusage | Frees any memory which may be used to store the usage information. |
query | |
same_resourceusage | Returns 0 if the numbers of resources equals the numbers stored in usage. |
update |
size_t mmtrans_usage
Number of memory bytes allocated by mm_impl_t.
size_t mmtrans_correction
Number of bytes resourceusage_t uses itself.
size_t malloc_correction
Number of bytes resourceusage_t uses itself.
size_t pagecache_correction
Size of pages resourceusage_t uses itself.
size_t pagecache_staticusage
Size of static memory allocated in pagecache_t.
resourceusage_t | |
acceptmallocleak_resourceusage | Implements <resourceusage_t.acceptmallocleak_resourceusage>. |
Exports resourceusage_t.
typedef struct resourceusage_t resourceusage_t
Stores the number of resources currently in use.
struct resourceusage_t
Unittest for query usage & releasing all resources.
int unittest_test_resourceusage( void )
Number of open files.
size_t file_usage
Number of memory bytes allocated by mm_impl_t.
size_t mmtrans_usage
Default memory manager for allocating/freeing blocks of memory.
struct mm_impl_t
Number of bytes resourceusage_t uses itself.
size_t mmtrans_correction
Number of memory bytes allocated by malloc.
size_t malloc_usage
Number of bytes resourceusage_t uses itself.
size_t malloc_correction
Sum of size of all cache memory pages.
size_t pagecache_usage
Size of pages resourceusage_t uses itself.
size_t pagecache_correction
Size of static memory allocated in pagecache_t.
size_t pagecache_staticusage
Uses iobj_DECLARE to declare interfaceable object.
iobj_DECLARE( pagecache_t, pagecache )
Stores configuration state of signal subsystem.
struct signalstate_t * signalstate
Layout of virtual memory.
struct vm_mappedregions_t * virtualmemory_usage
Holds maximum number of bytes of accepted malloc memory leak.
uint16_t malloc_acceptleak
Static initializer.
#define resourceusage_FREE { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
Stores the number of resources currently in use.
int init_resourceusage( /*out*/resourceusage_t * usage )
Frees any memory which may be used to store the usage information.
int free_resourceusage( resourceusage_t * usage )
Returns 0 if the numbers of resources equals the numbers stored in usage.
int same_resourceusage( const resourceusage_t * usage )
Implements resourceusage_t.acceptmallocleak_resourceusage.
#define acceptmallocleak_resourceusage( usage, malloc_leak_in_bytes ) do { (usage)->malloc_acceptleak = (malloc_leak_in_bytes); } while (0)