/* * OS specific utility functions * (C) 2015 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_OS_UTILS_H__ #define BOTAN_OS_UTILS_H__ #include namespace Botan { namespace OS { /* * Returns the maximum amount of memory (in bytes) we could/should * hyptothetically allocate. Reads "BOTAN_MLOCK_POOL_SIZE" from * environment which can be set to zero. */ size_t get_memory_locking_limit(); /* * Request so many bytes of page-aligned RAM locked into memory OS * calls (mlock, VirtualLock, or similar). Returns null on failure. The * memory returned is zeroed. Free it with free_locked_pages. */ void* allocate_locked_pages(size_t length); /* * Free memory allocated by allocate_locked_pages */ void free_locked_pages(void* ptr, size_t length); } } #endif