Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1411)

Side by Side Diff: xfa/src/fgas/include/fx_mem.h

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/src/fgas/include/fx_locale.h ('k') | xfa/src/fgas/include/fx_rbk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7 #ifndef _FX_MEMORY
8 #define _FX_MEMORY 8 #define _FX_MEMORY
9 class IFX_MEMAllocator; 9 class IFX_MEMAllocator;
10 class CFX_Target; 10 class CFX_Target;
(...skipping 13 matching lines...) Expand all
24 virtual size_t GetDefChunkSize() const = 0; 24 virtual size_t GetDefChunkSize() const = 0;
25 virtual size_t SetDefChunkSize(size_t size) = 0; 25 virtual size_t SetDefChunkSize(size_t size) = 0;
26 virtual size_t GetCurrentDataSize() const = 0; 26 virtual size_t GetCurrentDataSize() const = 0;
27 }; 27 };
28 IFX_MEMAllocator* FX_CreateAllocator(FX_ALLOCTYPE eType, size_t chunkSize, size_t blockSize); 28 IFX_MEMAllocator* FX_CreateAllocator(FX_ALLOCTYPE eType, size_t chunkSize, size_t blockSize);
29 class CFX_Target 29 class CFX_Target
30 { 30 {
31 public: 31 public:
32 void* operator new(size_t size) 32 void* operator new(size_t size)
33 { 33 {
34 return FX_Alloc(FX_BYTE, size); 34 return FX_Alloc(uint8_t, size);
35 } 35 }
36 void operator delete(void *p) 36 void operator delete(void *p)
37 { 37 {
38 FX_Free(p); 38 FX_Free(p);
39 } 39 }
40 void* operator new(size_t size, IFX_MEMAllocator *pAllocator) 40 void* operator new(size_t size, IFX_MEMAllocator *pAllocator)
41 { 41 {
42 return pAllocator->Alloc(size); 42 return pAllocator->Alloc(size);
43 } 43 }
44 void operator delete(void *p, IFX_MEMAllocator *pAllocator) 44 void operator delete(void *p, IFX_MEMAllocator *pAllocator)
45 { 45 {
46 pAllocator->Free(p); 46 pAllocator->Free(p);
47 } 47 }
48 void* operator new(size_t size, void *place) 48 void* operator new(size_t size, void *place)
49 { 49 {
50 return place; 50 return place;
51 } 51 }
52 void operator delete(void *p, void *place) {} 52 void operator delete(void *p, void *place) {}
53 }; 53 };
54 #define FXTARGET_New new 54 #define FXTARGET_New new
55 #define FXTARGET_NewWith(__allocator__) new(__allocator__) 55 #define FXTARGET_NewWith(__allocator__) new(__allocator__)
56 #define FXTARGET_Delete delete 56 #define FXTARGET_Delete delete
57 #define FXTARGET_DeleteWith(__class__, __allocator__, pointer) {(pointer)->~__c lass__(); (pointer)->operator delete((pointer), (__allocator__));} 57 #define FXTARGET_DeleteWith(__class__, __allocator__, pointer) {(pointer)->~__c lass__(); (pointer)->operator delete((pointer), (__allocator__));}
58 #endif 58 #endif
OLDNEW
« no previous file with comments | « xfa/src/fgas/include/fx_locale.h ('k') | xfa/src/fgas/include/fx_rbk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698