mirror of
https://github.com/TokTok/c-toxcore
synced 2026-06-06 17:42:34 +00:00
9c22e79cc8
Introduces a new testing support library 'testing/support' that provides a clean, modular, and fully deterministic environment for testing toxcore components.
24 lines
499 B
C++
24 lines
499 B
C++
#ifndef C_TOXCORE_TESTING_SUPPORT_PUBLIC_MEMORY_H
|
|
#define C_TOXCORE_TESTING_SUPPORT_PUBLIC_MEMORY_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
|
|
namespace tox::test {
|
|
|
|
/**
|
|
* @brief Abstraction over the memory allocator.
|
|
*/
|
|
class MemorySystem {
|
|
public:
|
|
virtual ~MemorySystem();
|
|
|
|
virtual void *malloc(size_t size) = 0;
|
|
virtual void *realloc(void *ptr, size_t size) = 0;
|
|
virtual void free(void *ptr) = 0;
|
|
};
|
|
|
|
} // namespace tox::test
|
|
|
|
#endif // C_TOXCORE_TESTING_SUPPORT_PUBLIC_MEMORY_H
|