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 _FX_MEMORY_H_ | 7 #ifndef _FX_MEMORY_H_ |
8 #define _FX_MEMORY_H_ | 8 #define _FX_MEMORY_H_ |
9 #ifndef _FX_SYSTEM_H_ | 9 |
10 #include "fx_system.h" | 10 #include "fx_system.h" |
11 #endif | 11 |
12 #ifdef __cplusplus | 12 #ifdef __cplusplus |
13 extern "C" { | 13 extern "C" { |
14 #endif | 14 #endif |
15 #define FX_Alloc(type, size) (type*)c
alloc(size, sizeof(type)) | 15 #define FX_Alloc(type, size) (type*)c
alloc(size, sizeof(type)) |
16 #define FX_Realloc(type, ptr, size) (type*)r
ealloc(ptr, sizeof(type) * (size)) | 16 #define FX_Realloc(type, ptr, size) (type*)r
ealloc(ptr, sizeof(type) * (size)) |
17 #define FX_AllocNL(type, size) FX_Alloc
(type, size) | 17 #define FX_AllocNL(type, size) FX_Alloc
(type, size) |
18 #define FX_ReallocNL(type, ptr, size) FX_Realloc(type,
ptr, size) | 18 #define FX_ReallocNL(type, ptr, size) FX_Realloc(type,
ptr, size) |
19 #define FX_Free(ptr)
free(ptr) | 19 #define FX_Free(ptr)
free(ptr) |
20 void* FXMEM_DefaultAlloc(size_t byte_size, int flags); | 20 void* FXMEM_DefaultAlloc(size_t byte_size, int flags); |
21 void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags); | 21 void* FXMEM_DefaultRealloc(void* pointer, size_t new_size, int flags); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 void FreeAll(); | 126 void FreeAll(); |
127 private: | 127 private: |
128 | 128 |
129 size_t m_TrunkSize; | 129 size_t m_TrunkSize; |
130 | 130 |
131 void* m_pFirstTrunk; | 131 void* m_pFirstTrunk; |
132 }; | 132 }; |
133 #endif | 133 #endif |
134 #endif | 134 #endif |
OLD | NEW |