1 // Copyright 2019 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TESTING_FREE_DELETER_H_ 6 #define TESTING_FREE_DELETER_H_ 7 8 #include <stdlib.h> 9 10 namespace pdfium { 11 12 // Used with std::unique_ptr to free() objects that can't be deleted. 13 struct FreeDeleter { operatorFreeDeleter14 inline void operator()(void* ptr) const { free(ptr); } 15 }; 16 17 } // namespace pdfium 18 19 #endif // TESTING_FREE_DELETER_H_ 20