| 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 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "xfa/src/fgas/src/crt/fx_memory.h" |
| 9 #include "xfa/src/fgas/src/fgas_base.h" | 10 #include "xfa/src/fgas/src/fgas_base.h" |
| 10 #include "xfa/src/fgas/src/crt/fx_memory.h" | |
| 11 #define FX_4BYTEALIGN(size) (((size) + 3) / 4 * 4) | 11 #define FX_4BYTEALIGN(size) (((size) + 3) / 4 * 4) |
| 12 IFX_MEMAllocator* FX_CreateAllocator(FX_ALLOCTYPE eType, | 12 IFX_MEMAllocator* FX_CreateAllocator(FX_ALLOCTYPE eType, |
| 13 size_t chunkSize, | 13 size_t chunkSize, |
| 14 size_t blockSize) { | 14 size_t blockSize) { |
| 15 switch (eType) { | 15 switch (eType) { |
| 16 #ifndef _FXEMB | 16 #ifndef _FXEMB |
| 17 case FX_ALLOCTYPE_Dynamic: | 17 case FX_ALLOCTYPE_Dynamic: |
| 18 return new CFX_DynamicStore(chunkSize); | 18 return new CFX_DynamicStore(chunkSize); |
| 19 #endif | 19 #endif |
| 20 case FX_ALLOCTYPE_Default: | 20 case FX_ALLOCTYPE_Default: |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 FX_Free(pChunk); | 315 FX_Free(pChunk); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 size_t CFX_DynamicStore::SetDefChunkSize(size_t size) { | 318 size_t CFX_DynamicStore::SetDefChunkSize(size_t size) { |
| 319 FXSYS_assert(size != 0); | 319 FXSYS_assert(size != 0); |
| 320 size_t v = m_iDefChunkSize; | 320 size_t v = m_iDefChunkSize; |
| 321 m_iDefChunkSize = size; | 321 m_iDefChunkSize = size; |
| 322 return v; | 322 return v; |
| 323 } | 323 } |
| 324 #endif | 324 #endif |
| OLD | NEW |