Offers a simple cache mechanism for objects needed in submodules either often or which are costly to construct or deconstruct.
Valuecache | Offers a simple cache mechanism for objects needed in submodules either often or which are costly to construct or deconstruct. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file of Valuecache. |
C-kern/ | Implementation file Valuecache impl. |
Types | |
struct valuecache_t | Exports valuecache_t. |
Functions | |
test | |
unittest_cache_valuecache | Test allocation and free works. |
valuecache_t | Caches values which have to be computed only once. |
pagesize_vm | The size of a virtual memory page in bytes. |
log2pagesize_vm | The log2_int value of pagesize_vm. |
lifetime | |
valuecache_FREE | Static initializer. |
init_valuecache | Sets values of valuecache. |
free_valuecache | Clears values of valuecache. |
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 Valuecache.
Implementation file Valuecache impl.
typedef struct valuecache_t valuecache_t
Exports valuecache_t.
test | |
unittest_cache_valuecache | Test allocation and free works. |
struct valuecache_t
Caches values which have to be computed only once.
pagesize_vm | The size of a virtual memory page in bytes. |
log2pagesize_vm | The log2_int value of pagesize_vm. |
lifetime | |
valuecache_FREE | Static initializer. |
init_valuecache | Sets values of valuecache. |
free_valuecache | Clears values of valuecache. |
uint32_t pagesize_vm
The size of a virtual memory page in bytes. Same value as returned by sys_pagesize_vm. This value can be queried with function pagesize_vm.
uint8_t log2pagesize_vm
The log2_int value of pagesize_vm.
Exports valuecache_t.
typedef struct valuecache_t valuecache_t
Caches values which have to be computed only once.
struct valuecache_t
Test allocation and free works.
int unittest_cache_valuecache( void )
The size of a virtual memory page in bytes.
uint32_t pagesize_vm
The log2_int value of pagesize_vm.
uint8_t log2pagesize_vm
Static initializer.
#define valuecache_FREE { 0, 0 }
Sets values of valuecache.
int init_valuecache( /*out*/valuecache_t * valuecache )
Clears values of valuecache.
int free_valuecache( valuecache_t * valuecache )
Returns the virtual memory page size supported by the underlying system.
uint32_t sys_pagesize_vm( void )