OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FGAS_CRT_FGAS_MEMORY_H_ | 7 #ifndef XFA_FGAS_CRT_FGAS_MEMORY_H_ |
8 #define XFA_FGAS_CRT_FGAS_MEMORY_H_ | 8 #define XFA_FGAS_CRT_FGAS_MEMORY_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxcrt/include/fx_memory.h" | 12 #include "core/fxcrt/fx_memory.h" |
13 #include "core/fxcrt/include/fx_system.h" | 13 #include "core/fxcrt/fx_system.h" |
14 | 14 |
15 enum FX_ALLOCTYPE { | 15 enum FX_ALLOCTYPE { |
16 FX_ALLOCTYPE_Static, | 16 FX_ALLOCTYPE_Static, |
17 FX_ALLOCTYPE_Fixed, | 17 FX_ALLOCTYPE_Fixed, |
18 }; | 18 }; |
19 | 19 |
20 class IFX_MemoryAllocator { | 20 class IFX_MemoryAllocator { |
21 public: | 21 public: |
22 virtual ~IFX_MemoryAllocator() {} | 22 virtual ~IFX_MemoryAllocator() {} |
23 virtual void* Alloc(size_t size) = 0; | 23 virtual void* Alloc(size_t size) = 0; |
(...skipping 20 matching lines...) Expand all Loading... |
44 }; | 44 }; |
45 | 45 |
46 #define FXTARGET_NewWith(__allocator__) new (__allocator__) | 46 #define FXTARGET_NewWith(__allocator__) new (__allocator__) |
47 #define FXTARGET_DeleteWith(__class__, __allocator__, pointer) \ | 47 #define FXTARGET_DeleteWith(__class__, __allocator__, pointer) \ |
48 { \ | 48 { \ |
49 (pointer)->~__class__(); \ | 49 (pointer)->~__class__(); \ |
50 (pointer)->operator delete((pointer), (__allocator__)); \ | 50 (pointer)->operator delete((pointer), (__allocator__)); \ |
51 } | 51 } |
52 | 52 |
53 #endif // XFA_FGAS_CRT_FGAS_MEMORY_H_ | 53 #endif // XFA_FGAS_CRT_FGAS_MEMORY_H_ |
OLD | NEW |