xref: /aosp_15_r20/external/pdfium/testing/free_deleter.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2019 The PDFium Authors
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