test_memory_manager.cc (643B)
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #include "lib/jxl/test_memory_manager.h" 7 8 #include <jxl/memory_manager.h> 9 10 #include <cstdlib> 11 12 namespace jxl { 13 namespace test { 14 15 namespace { 16 void* TestAlloc(void* /* opaque*/, size_t size) { return malloc(size); } 17 void TestFree(void* /* opaque*/, void* address) { free(address); } 18 JxlMemoryManager kMemoryManager{nullptr, &TestAlloc, &TestFree}; 19 } // namespace 20 21 JxlMemoryManager* MemoryManager() { return &kMemoryManager; }; 22 23 } // namespace test 24 } // namespace jxl