58 #define FXMEM_NONLEAVE 1 60 #define FXMEM_MOVABLE 2 62 #define FXMEM_DISCARDABLE 4 72 typedef struct _FXMEM_SystemMgr {
85 void* (*Alloc)(
struct _FXMEM_SystemMgr* pMgr,
size_t size,
int flags);
100 void* (*AllocDebug)(
struct _FXMEM_SystemMgr* pMgr,
size_t size,
int flags,
FX_LPCSTR file,
int line);
114 void* (*Realloc)(
struct _FXMEM_SystemMgr* pMgr,
void* pointer,
size_t size,
int flags);
130 void* (*ReallocDebug)(
struct _FXMEM_SystemMgr* pMgr,
void* pointer,
size_t size,
int flags,
FX_LPCSTR file,
int line);
142 void* (*Lock)(
struct _FXMEM_SystemMgr* pMgr,
void* handle);
154 void (*Unlock)(
struct _FXMEM_SystemMgr* pMgr,
void* handle);
167 void (*Free)(
struct _FXMEM_SystemMgr* pMgr,
void* pointer,
int flags);
178 void (*Purge)(
struct _FXMEM_SystemMgr* pMgr);
189 void (*CollectAll)(
struct _FXMEM_SystemMgr* pMgr);
249 typedef struct _FXMEM_SystemMgr2
261 FX_BOOL (*More)(
struct _FXMEM_SystemMgr2* pMgr,
size_t alloc_size,
void** new_memory,
size_t* new_size);
270 void (*Free)(
struct _FXMEM_SystemMgr2* pMgr,
void* memory);
359 void*
FXMEM_Alloc(FXMEM_FoxitMgr* pFoxitMgr,
size_t size,
int flags);
382 void*
FXMEM_Realloc(FXMEM_FoxitMgr* pFoxitMgr,
void* pointer,
size_t new_size,
int flags);
405 void FXMEM_Free(FXMEM_FoxitMgr* pFoxitMgr,
void* pointer,
int flags);
455 void (*OnAlloc)(FXMEM_FoxitMgr* pMgr,
void* p,
size_t size,
int flags);
471 void (*OnAllocDebug)(FXMEM_FoxitMgr* pMgr,
void* p,
size_t size,
int flags,
FX_LPCSTR file,
int line);
486 void (*OnRealloc)(FXMEM_FoxitMgr* pMgr,
void* old_p,
void* new_p,
size_t size,
int flags);
503 void (*OnReallocDebug)(FXMEM_FoxitMgr* pMgr,
void* old_p,
void* new_p,
size_t size,
int flags,
FX_LPCSTR file,
int line);
516 void (*OnFree)(FXMEM_FoxitMgr* pMgr,
void* p,
int flags);
679 #define FX_Alloc(type, size) (type*)FXMEM_DefaultAllocDebug2(size, sizeof(type), 0, __FILE__, __LINE__) 680 #define FX_Realloc(type, ptr, new_size) (type*)FXMEM_DefaultReallocDebug2(ptr, new_size, sizeof(type), 0, __FILE__, __LINE__) 686 #define FX_Alloc(type, size) (type*)FXMEM_DefaultAlloc2(size, sizeof(type), 0) 691 #define FX_Realloc(type, ptr, size) (type*)FXMEM_DefaultRealloc2(ptr, size, sizeof(type), 0) 695 #define FX_AllocNL(type, size) (type*)FXMEM_DefaultAllocDebug2(size, sizeof(type), FXMEM_NONLEAVE, __FILE__, __LINE__) 696 #define FX_ReallocNL(type, ptr, new_size) (type*)FXMEM_DefaultReallocDebug2(ptr, new_size, sizeof(type), FXMEM_NONLEAVE, __FILE__, __LINE__) 702 #define FX_AllocNL(type, size) (type*)FXMEM_DefaultAlloc2(size, sizeof(type), FXMEM_NONLEAVE) 707 #define FX_ReallocNL(type, ptr, size) (type*)FXMEM_DefaultRealloc2(ptr, size, sizeof(type), FXMEM_NONLEAVE) 711 #define FX_Free(pointer) FXMEM_DefaultFree(pointer, 0) 723 #if __cplusplus >= 201103L 724 #define FX_EQDELETE = delete 725 #define FX_NOEXCEPT noexcept 726 #define FX_EXPLICIT_OPERATOR explicit 728 #define FX_EQDELETE //= delete 729 #define FX_NOEXCEPT //noexcept 730 #define FX_EXPLICIT_OPERATOR //explicit 735 template <
typename T,
typename D = std::default_delete<T>>
736 class CFX_MaybeOwned {
738 CFX_MaybeOwned() : m_pObj(
nullptr) {}
739 explicit CFX_MaybeOwned(T* ptr) : m_pObj(ptr) {}
740 explicit CFX_MaybeOwned(std::unique_ptr<T, D> ptr)
741 : m_pOwnedObj(std::move(ptr)), m_pObj(m_pOwnedObj.get()) {}
743 CFX_MaybeOwned(CFX_MaybeOwned&& that) FX_NOEXCEPT
744 : m_pOwnedObj(that.m_pOwnedObj.release()), m_pObj(that.m_pObj) {
745 that.m_pObj =
nullptr;
748 void Reset(std::unique_ptr<T, D> ptr) {
749 m_pOwnedObj = std::move(ptr);
750 m_pObj = m_pOwnedObj.get();
752 void Reset(T* ptr =
nullptr) {
757 bool IsOwned()
const {
return !!m_pOwnedObj; }
758 T* Get()
const {
return m_pObj; }
759 std::unique_ptr<T, D> Release() {
761 return std::move(m_pOwnedObj);
764 CFX_MaybeOwned& operator=(CFX_MaybeOwned&& that) {
765 m_pOwnedObj = std::move(that.m_pOwnedObj);
766 m_pObj = that.m_pObj;
767 that.m_pObj =
nullptr;
770 CFX_MaybeOwned& operator=(T* ptr) {
774 CFX_MaybeOwned& operator=(std::unique_ptr<T, D> ptr) {
775 Reset(std::move(ptr));
779 bool operator==(
const CFX_MaybeOwned& that)
const {
780 return Get() == that.Get();
782 bool operator==(
const std::unique_ptr<T, D>& ptr)
const {
783 return Get() == ptr.get();
785 bool operator==(T* ptr)
const {
return Get() == ptr; }
787 bool operator!=(
const CFX_MaybeOwned& that)
const {
return !(*
this == that); }
788 bool operator!=(
const std::unique_ptr<T, D> ptr)
const {
789 return !(*
this == ptr);
791 bool operator!=(T* ptr)
const {
return !(*
this == ptr); }
793 FX_EXPLICIT_OPERATOR
operator bool()
const {
return !!m_pObj; }
794 T& operator*()
const {
return *m_pObj; }
795 T* operator->()
const {
return m_pObj; }
797 CFX_MaybeOwned(
const CFX_MaybeOwned& that) FX_EQDELETE;
798 CFX_MaybeOwned& operator=(
const CFX_MaybeOwned& that) FX_EQDELETE;
801 std::unique_ptr<T, D> m_pOwnedObj;
806 struct CFX_FreeDeleter {
807 inline void operator()(
void* ptr)
const {
FX_Free(ptr); }
828 void*
operator new (
size_t size,
FX_LPCSTR file,
int line);
829 #ifndef _FX_NO_EXCEPTION_ 839 void operator delete (
void* p,
FX_LPCSTR file,
int line);
849 void*
operator new (
size_t size);
857 void operator delete (
void* p);
868 void*
operator new[] (
size_t size,
FX_LPCSTR file,
int line);
869 #ifndef _FX_NO_EXCEPTION_ 879 void operator delete[] (
void* p,
FX_LPCSTR file,
int line);
889 void*
operator new[] (
size_t size);
897 void operator delete[] (
void* p);
902 void*
operator new (size_t,
void* buf) {
return buf; }
903 #ifndef _FX_NO_EXCEPTION_ 907 void operator delete (
void*,
void*) {}
918 #if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_) && !defined(__PLACEMENT_NEW_INLINE) && !defined(_MFC_VER) && !defined(_NEW) 919 #define __PLACEMENT_NEW_INLINE 921 inline void*
operator new(
size_t size,
void* pos)
926 inline void operator delete(
void* ptr,
void* pos)
929 #endif //__PLACEMENT_NEW_INLINE 939 #define FX_NEW new(__FILE__, __LINE__) 949 #ifndef _FPDFAPI_MINI_ 952 #define FX_NEW_VECTOR(Pointer, Class, Count) Pointer = FX_NEW Class[Count] 954 #define FX_DELETE_VECTOR(Pointer, Class, Count) delete[] Pointer 958 #define FX_NEW_VECTOR(Pointer, Class, Count) \ 960 Pointer = FX_Alloc(Class, Count); \ 962 for (int i = 0; i < (Count); i ++) new (Pointer + i) Class; \ 965 #define FX_DELETE_VECTOR(Pointer, Class, Count) \ 967 for (int i = 0; i < (Count); i ++) Pointer[i].~Class(); \ 978 class CFX_DestructObject :
public CFX_Object
982 virtual ~CFX_DestructObject() {}
994 typedef struct _IFX_Allocator
1009 void* (*m_AllocDebug)(
struct _IFX_Allocator* pAllocator,
size_t size,
FX_LPCSTR file,
int line);
1021 void* (*m_Alloc)(
struct _IFX_Allocator* pAllocator,
size_t size);
1036 void* (*m_ReallocDebug)(
struct _IFX_Allocator* pAllocator,
void* p,
size_t size,
FX_LPCSTR file,
int line);
1049 void* (*m_Realloc)(
struct _IFX_Allocator* pAllocator,
void* p,
size_t size);
1061 void (*m_Free)(
struct _IFX_Allocator* pAllocator,
void* p);
1077 #define FX_Allocator_Alloc(fxAllocator, type, size) \ 1078 ((fxAllocator) ? (type*)(fxAllocator)->m_AllocDebug((fxAllocator), (size) * sizeof(type), __FILE__, __LINE__) : (FX_Alloc(type, size))) 1080 #define FX_Allocator_Realloc(fxAllocator, type, ptr, new_size) \ 1081 ((fxAllocator) ? (type*)(fxAllocator)->m_ReallocDebug((fxAllocator), (ptr), (new_size) * sizeof(type), __FILE__, __LINE__) : (FX_Realloc(type, ptr, new_size))) 1084 #define FX_Allocator_Alloc(fxAllocator, type, size) \ 1085 ((fxAllocator) ? (type*)(fxAllocator)->m_Alloc((fxAllocator), (size) * sizeof(type)) : (FX_Alloc(type, size))) 1087 #define FX_Allocator_Realloc(fxAllocator, type, ptr, new_size) \ 1088 ((fxAllocator) ? (type*)(fxAllocator)->m_Realloc((fxAllocator), (ptr), (new_size) * sizeof(type)) : (FX_Realloc(type, ptr, new_size))) 1091 #define FX_Allocator_Free(fxAllocator, ptr) \ 1092 ((fxAllocator) ? (fxAllocator)->m_Free((fxAllocator), (ptr)) : (FX_Free(ptr))) 1098 inline void*
operator new(
size_t size,
IFX_Allocator* fxAllocator)
1103 inline void operator delete(
void* ptr,
IFX_Allocator* fxAllocator)
1109 #define FX_NewAtAllocator(fxAllocator) \ 1110 ::new(static_cast<IFX_Allocator*>(fxAllocator)) 1112 #define FX_DeleteAtAllocator(pointer, fxAllocator, __class__) \ 1113 do { (pointer)->~__class__(); ::operator delete(static_cast<void*>(pointer), static_cast<IFX_Allocator*>(fxAllocator)); } while(false) 1120 class CFX_AllocObject
1134 #ifndef _FX_NO_EXCEPTION_ 1156 void*
operator new (
size_t size,
IFX_Allocator* pAllocator);
1164 void operator delete (
void* p);
1165 #ifndef _FX_NO_EXCEPTION_ 1180 void*
operator new (size_t,
void* buf) {
return buf; }
1181 #ifndef _FX_NO_EXCEPTION_ 1185 void operator delete (
void*,
void*) {}
1193 IFX_Allocator* GetAllocator()
const {
return m_pAllocator; }
1206 void*
operator new[] (
size_t size,
IFX_Allocator* pAllocator,
FX_LPCSTR file,
int line) {
return operator new(size, pAllocator, file, line); }
1207 #ifndef _FX_NO_EXCEPTION_ 1229 void*
operator new[] (
size_t size,
IFX_Allocator* pAllocator) {
return operator new(size, pAllocator); }
1237 void operator delete[] (
void* p) {}
1238 #ifndef _FX_NO_EXCEPTION_ 1247 void operator delete[] (
void* p,
IFX_Allocator* pAllocator) {}
1258 #define FX_NEWAT(pAllocator) new(pAllocator, __FILE__, __LINE__) 1264 #define FX_NEWAT(pAllocator) new(pAllocator) 1271 #if !defined(_FPDFAPI_MT_NONE_) && !defined(_FPDFAPI_MT_) 1273 #define _FPDFAPI_MT_ 1280 class CFX_LockObject :
public CFX_Object
1284 CFX_LockObject() {FX_InitializeCriticalSection(&m_Lock);}
1286 ~CFX_LockObject() {FX_DeleteCriticalSection(&m_Lock);}
1289 FX_BOOL TryLock() {
return FX_TryEnterCriticalSection(&m_Lock);}
1291 void Lock() {FX_EnterCriticalSection(&m_Lock);}
1293 void Unlock() {FX_LeaveCriticalSection(&m_Lock);}
1297 FX_CRITICAL_SECTION m_Lock;
1298 friend class CFX_CSLock;
1308 CFX_CSLock() : m_pCS(
NULL) {}
1310 CFX_CSLock(FX_CRITICAL_SECTION* pCS) : m_pCS(pCS) {
if (m_pCS) FX_EnterCriticalSection(m_pCS);}
1312 CFX_CSLock(CFX_LockObject* pObj) {m_pCS = &pObj->m_Lock; FX_EnterCriticalSection(m_pCS);}
1314 ~CFX_CSLock() {
if (m_pCS) FX_LeaveCriticalSection(m_pCS);}
1317 FX_CRITICAL_SECTION* m_pCS;
1321 #define FXMT_CSLOCK_THIS CFX_CSLock _fx_lock((CFX_LockObject*)this) 1323 #define FXMT_CSLOCK_OBJ(lock) CFX_CSLock _fx_lock((CFX_LockObject*)lock) 1325 #define FXMT_CSLOCK_DEFINEOBJ(csLock, lock) CFX_CSLock csLock((CFX_LockObject*)lock) 1328 #define FXMT_LOCKOBJECT_DEFINE(lockObj) CFX_LockObject lockObj 1330 #define FXMT_LOCKOBJECT_TRYLOCK(lockObj) (lockObj)->TryLock() 1332 #define FXMT_LOCKOBJECT_TRYLOCK_IF(lockObj) if ((lockObj)->TryLock()) 1334 #define FXMT_LOCKOBJECT_LOCK(lockObj) (lockObj)->Lock() 1336 #define FXMT_LOCKOBJECT_UNLOCK(lockObj) (lockObj)->Unlock() 1338 class CFX_LockObject : public CFX_Object {}; 1339 #define FXMT_CSLOCK_THIS 1340 #define FXMT_CSLOCK_OBJ(lock) 1341 #define FXMT_CSLOCK_DEFINEOBJ(csLock, lock) 1343 #define FXMT_LOCKOBJECT_DEFINE(lockObj) 1344 #define FXMT_LOCKOBJECT_TRYLOCK(lockObj) 1345 #define FXMT_LOCKOBJECT_TRYLOCK_IF(lockObj) if (1) 1346 #define FXMT_LOCKOBJECT_LOCK(lockObj) 1347 #define FXMT_LOCKOBJECT_UNLOCK(lockObj) 1358 class CFX_GrowOnlyPool :
public IFX_Allocator,
public CFX_Object
1375 ~CFX_GrowOnlyPool();
1393 void SetTrunkSize(
size_t trunk_size) { m_TrunkSize = trunk_size; }
1404 void* AllocDebug(
size_t size,
FX_LPCSTR file,
int line) {
return Alloc(size); }
1412 void* Alloc(
size_t size);
1420 void* ReallocDebug(
void* p,
size_t new_size,
FX_LPCSTR file,
int line) {
return NULL; }
1428 void* Realloc(
void* p,
size_t new_size) {
return NULL; }
1434 void Free(
void* mem) {}
1447 void* m_pFirstTrunk;
1452 FX_CRITICAL_SECTION m_Lock;
1458 template <
class T>
class AllocProxy :
public CFX_Object {
1460 AllocProxy(
size_t size) { buffer = (T *)
FX_Alloc(T, size); }
1461 ~AllocProxy() {
if (buffer)
FX_Free(buffer); }
1462 T &operator[](
int index) {
return buffer[index]; }
1463 operator T *() {
return buffer; }
1464 T *
operator +(
int offset) {
return buffer + offset; }
1465 operator bool()
const {
return !!buffer; }
1466 T *operator->()
const {
return buffer; }
1469 AllocProxy(
const AllocProxy &) {}
1470 AllocProxy &operator=(
const AllocProxy &) {}
1476 struct CFX_ReleaseDeleter {
1477 inline void operator()(T* ptr)
const { ptr->Release(); }
1483 #endif //__cplusplus 1493 #define _FXMEM_NO64_ 1497 #define FX_FIXEDMEM_PAGESIZE (4096 * 16) 1499 #define FX_FIXEDMEM_MIDBLOCKSIZE (4096) 1502 typedef struct _FX_MEMCONFIG
1510 #if !defined(_FXMEM_NO64_) 1511 size_t nPageNum_Init64;
1517 #if !defined(_FXMEM_NO64_) 1518 size_t nPageNum_More64;
1520 #if defined(_FXMEM_LIT_) 1521 size_t nPageSize_Lit;
1522 size_t nPageNum_InitLit;
1523 size_t nPageNum_MoreLit;
1524 size_t nPageNum_ReservedLit;
1552 #if defined(_FX_MEMSTATE_) 1554 typedef struct _FX_MEMPAGESTATE_
1559 size_t nCurAvailSize;
1560 size_t nMinAvailSize;
1561 size_t nMaxAvailSize;
1562 size_t nCurUsedSize;
1563 size_t nMinUsedSize;
1564 size_t nMaxUsedSize;
1565 size_t nCurUsedRate;
1566 size_t nMinUsedRate;
1567 size_t nMaxUsedRate;
1570 typedef struct _FX_MEMINFO_
1572 size_t memBlockCount[64];
1573 FX_MEMPAGESTATE pageState8;
1574 FX_MEMPAGESTATE pageState16;
1575 FX_MEMPAGESTATE pageState32;
1576 FX_MEMPAGESTATE pageStateMid;
1577 FX_MEMPAGESTATE pageStateLarge;
1578 FX_MEMPAGESTATE totalState;
1581 #define FX_MEMSTATE_RATEFRACTION 100000 1583 void FX_MemState_MergeInfo(FX_MEMINFO *mi1,
const FX_MEMINFO *mi2);
1584 FX_MEMINFO* FX_MemState_GetInfo();
1585 void FX_MemState_ResetInfo();
1587 #endif //_FX_MEMSTATE_ 1596 #endif //_FX_MEMORY_H_ size_t nPageSize_Mid
中等数据范围(>32字节且<=FX_FIXEDMEM_MIDBLOCKSIZE)的内存页大小。桌面平台为32,有限内存环境为8。
Definition: fx_memory.h:1527
void * FXMEM_ReallocDebug(FXMEM_FoxitMgr *pFoxitMgr, void *pointer, size_t new_size, int flags, FX_LPCSTR file, int line)
Foxit调试模式基本内存重分配函数。
size_t FXMEM_GetBlockSizeInFixedMgr(FXMEM_FoxitMgr *pFoxitMgr, void *ptr)
获取 ptr 指向的内存块的大小。
int FXMEM_SetPyConfig(size_t lowByteRange, size_t highByteRange)
设置Python内存的配置。
void * FXMEM_DefaultAlloc2(size_t units, size_t unit_size, int flags)
使用当前模块默认Foxit内存管理器的默认分配函数。
#define FX_Allocator_Alloc(fxAllocator, type, size)
在分配器上进行发布模式分配。
Definition: fx_memory.h:1084
void FXMEM_Free(FXMEM_FoxitMgr *pFoxitMgr, void *pointer, int flags)
Foxit基本内存释放函数。
void FXMEM_PurgeMgr(FXMEM_FoxitMgr *pFoxitMgr)
释放所有多余的内存而不触及任何使用中的内存。 这对于可扩展固定内存管理器(FXMEM_SystemMgr2)很有用, 因为我们从不释放那些额外的内存池,直到内存管理器被销毁。
#define ASSERT(a)
调试模式的断言,发布模式下不执行任何操作。
Definition: fx_system.h:819
void * FXMEM_Alloc(FXMEM_FoxitMgr *pFoxitMgr, size_t size, int flags)
Foxit基本内存分配函数。
size_t nPageNum_Init8
8字节固定数据大小的初始内存页数。桌面平台为1,有限内存环境为1。
Definition: fx_memory.h:1505
void * FXMEM_Realloc(FXMEM_FoxitMgr *pFoxitMgr, void *pointer, size_t new_size, int flags)
Foxit基本内存重分配函数。
void FXMEM_DefaultFree(void *pointer, int flags)
使用当前模块默认Foxit内存管理器的默认释放函数。
IFX_Allocator * FXMEM_GetDefAllocator()
获取库使用的默认分配器。
size_t nPageSize_Large
大数据(>FX_FIXEDMEM_MIDBLOCKSIZE)的最小内存页大小。桌面平台为128,有限内存环境为32。
Definition: fx_memory.h:1533
#define FX_Alloc(type, size)
Foxit内存分配操作的宏。
Definition: fx_memory.h:686
size_t nPageNum_MoreMid
中等数据范围的更多内存页数。桌面平台为4,有限内存环境为4。
Definition: fx_memory.h:1531
FXMEM_FoxitMgr * FXMEM_CreateFoxitMgr(FXMEM_SystemMgr *pSystemMgr)
创建Foxit管理器。必须提供系统管理器用于实际分配。
void * user
用于用户数据的通用无类型指针。
Definition: fx_memory.h:192
void FXMEM_SetDefaultMgr(FXMEM_FoxitMgr *pFoxitMgr)
为当前编译模块(EXE、DLL等)设置默认Foxit管理器。
内存调试器接口。所有函数都必须实现。
Definition: fx_memory.h:441
void FXMEM_CollectAll(FXMEM_FoxitMgr *pFoxitMgr)
释放由Foxit管理器分配的所有内存块。此函数仅在嵌入式系统上支持。
bool operator==(const char *str1, const CFX_ByteString &str2)
检查两个字节字符串是否相等。
Definition: fs_basictypes.h:128
int FX_BOOL
布尔变量(应为TRUE或FALSE)。
Definition: fx_system.h:691
void FXMEM_SetConfig(const FX_MEMCONFIG *memConfig)
设置固定内存的配置。
void * FXMEM_DefaultRealloc(void *pointer, size_t new_size, int flags)
使用当前模块默认Foxit内存管理器的默认重分配函数。
char const * FX_LPCSTR
指向常量8位Windows (ANSI) 字符的指针。
Definition: fx_system.h:705
void FXMEM_ResetSystemMgr()
重置当前模块的Foxit系统内存管理器。
FXMEM_FoxitMgr * FXMEM_GetDefaultMgr()
获取当前模块的默认内存管理器。
void FXMEM_UseDebugger(FXMEM_FoxitMgr *pFoxitMgr, FXMEM_Debugger *pDebugger)
使用捕获所有内存活动的内存调试器。对参数 pDebugger 使用 NULL 停止调试。
固定内存管理器。
Definition: fx_memory.h:249
void * FXMEM_DefaultAllocDebug2(size_t units, size_t unit_size, int flags, FX_LPCSTR file, int line)
使用当前模块默认Foxit内存管理器的默认调试模式分配函数。
void FXMEM_DestroyFoxitMgr(FXMEM_FoxitMgr *pFoxitMgr)
销毁Foxit管理器实例。如果平台支持自动收集, 那么所有分配的内存块将被释放。
void FXMEM_OutputDebugTag(FXMEM_FoxitMgr *pFoxitMgr, FX_LPCSTR tag)
输出内存调试标签。
size_t nPageNum_Init32
32字节固定数据大小的初始内存页数。桌面平台为24,有限内存环境为8。
Definition: fx_memory.h:1509
size_t nPageNum_More16
16字节固定数据大小的更多内存页数。桌面平台为8,有限内存环境为4。
Definition: fx_memory.h:1514
void * FXMEM_DefaultReallocDebug2(void *pointer, size_t units, size_t unit_size, int flags, FX_LPCSTR file, int line)
使用当前模块默认Foxit内存管理器的默认调试模式重分配函数。
FXMEM_FoxitMgr * FXMEM_CreatePyMgr()
创建Python管理器。一个快速、专用的小块内存分配器,用于 在通用malloc之上使用——基于以前的技术。
CFX_ByteString operator+(FX_BSTR str1, FX_BSTR str2)
连接非缓冲字节字符串和非缓冲字节字符串。
Definition: fx_string.h:977
Foxit分配器接口。
Definition: fx_memory.h:994
void * FXMEM_DefaultAlloc(size_t byte_size, int flags)
使用当前模块默认Foxit内存管理器的默认分配函数。
#define FX_Free(pointer)
Foxit内存释放操作的宏。
Definition: fx_memory.h:711
FXMEM_FoxitMgr * FXMEM_CreateFixedMgr(void *pMemory, size_t size, FXMEM_SystemMgr2 *pExtender)
从预分配的固定内存缓冲区创建Foxit管理器。
系统级内存管理器。应用程序可以实现自己的系统内存管理器。
Definition: fx_memory.h:72
size_t nPageNum_InitMid
中等数据范围的初始内存页数。桌面平台为2,有限内存环境为2。
Definition: fx_memory.h:1529
void(* FPDF_OOM_Handler)(FXMEM_FoxitMgr *pFoxitMgr, void *param)
内存不足处理程序的原型。
Definition: fx_memory.h:559
size_t nPageNum_Init16
16字节固定数据大小的初始内存页数。桌面平台为8,有限内存环境为5。
Definition: fx_memory.h:1507
void * FXMEM_AllocDebug(FXMEM_FoxitMgr *pFoxitMgr, size_t size, int flags, FX_LPCSTR file, int line)
Foxit调试模式基本内存分配函数。
void FXMEM_ReportOOM(FXMEM_FoxitMgr *pFoxitMgr)
报告内存不足(OOM)。
void FXMEM_SetOOMHandler(FXMEM_FoxitMgr *pFoxitMgr, FPDF_OOM_Handler pOOMReportFunc, void *param)
为Foxit内存管理器设置内存不足处理程序。
size_t nPageNum_More32
32字节固定数据大小的更多内存页数。桌面平台为24,有限内存环境为12。
Definition: fx_memory.h:1516
FXMEM_FoxitMgr * FXMEM_CreateMemoryMgr(size_t size, FX_BOOL extensible)
创建固定内存管理器作为默认实现。
void * FXMEM_DefaultAllocDebug(size_t size, int flags, FX_LPCSTR file, int line)
使用当前模块默认Foxit内存管理器的默认调试模式分配函数。
固定内存配置结构。
Definition: fx_memory.h:1502
void * FXMEM_DefaultRealloc2(void *pointer, size_t units, size_t unit_size, int flags)
使用当前模块默认Foxit内存管理器的默认重分配函数。
size_t nPageSize_Alone
大数据独立内存页的最小大小。桌面平台为64,有限内存环境为64。
Definition: fx_memory.h:1535
#define NULL
空指针值。
Definition: fx_system.h:792
#define FX_DEFINEHANDLE(name)
定义句柄类型的宏。
Definition: fx_system.h:772
bool operator!=(const char *str1, const CFX_ByteString &str2)
检查两个字节字符串是否不相等。
Definition: fs_basictypes.h:140
#define FX_Allocator_Free(fxAllocator, ptr)
在分配器上释放内存块。
Definition: fx_memory.h:1091
void * FXMEM_DefaultReallocDebug(void *pointer, size_t new_size, int flags, FX_LPCSTR file, int line)
使用当前模块默认Foxit内存管理器的默认调试模式重分配函数。
unsigned char FX_BYTE
字节(8位)。
Definition: fx_system.h:665