API referenceCore SDK

pdfGetAllocBy

A flat-C-API-compatible memory-allocator debugging/tuning cluster:

C
int32_t __stdcall pdfGetAllocBy(PPDF IPDF);
BOOL32 __stdcall pdfSetAllocBy(PPDF IPDF, int32_t Value);
uint32_t __stdcall pdfGetAllocCount(void);
uint32_t __stdcall pdfGetDenyAllocAt(void);
void __stdcall pdfSetDenyAllocAt(uint32_t Count);
uint32_t __stdcall pdfGetDenyCount(void);
Delphi
function pdfGetAllocBy(const IPDF: PPDF): Integer; stdcall;
function pdfSetAllocBy(const IPDF: PPDF; Value: Integer): LongBool; stdcall;
function pdfGetAllocCount: Cardinal; stdcall;
function pdfGetDenyAllocAt: Cardinal; stdcall;
procedure pdfSetDenyAllocAt(Count: Cardinal); stdcall;
function pdfGetDenyCount: Cardinal; stdcall;

Purpose. A flat-C-API-compatible memory-allocator debugging/tuning cluster: per-document allocation-growth granularity (AllocBy), and process-wide allocation-failure-injection counters (AllocCount/DenyAllocAt/ DenyCount — a classic "fail the Nth allocation" fault-injection testing hook).

Description. Verified entirely inert, across all six functions. pdfSetAllocBy stores Value * 1024 (KB→bytes, an explicit documented DIFF from the classic API's storage convention) into FAllocBy (pdfGetAllocBy's default is 16384 bytes, itself a DIFF default); FAllocBy has exactly these declaration/init/getter/setter references and is never consulted by any actual memory-allocation code — this engine does not implement a custom allocator with tunable growth chunks. The four process-wide counters (GAllocCount, GDenyAllocAt, GDenyCount) are declared globals initialized to 0; pdfGetAllocCount/pdfGetDenyCount always return 0 (never incremented anywhere in the codebase), and while pdfSetDenyAllocAt/pdfGetDenyAllocAt do genuinely store/read back a value, no allocation-failure-injection logic anywhere reads GDenyAllocAt to actually deny an allocation at that count — setting it has no effect on subsequent behavior.

Parameters.

ParameterDescription
IPDF*(AllocBy only)* Document handle.
Value*(SetAllocBy)* Stored (* 1024) but never consulted.
Count*(SetDenyAllocAt)* Stored but never consulted by any fault-injection logic.

Return value. pdfGetAllocBy: the stored (inert) value; 0 if IPDF invalid. pdfSetAllocBy: True if IPDF valid. The four process-wide getters: always 0 for AllocCount/DenyCount; the stored (inert) value for DenyAllocAt.

Remarks. This entire cluster exists purely for classic flat C ABI/API compatibility; none of it affects real memory-allocation behavior in this engine.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetAllocBy(IntPtr IPDF);
Area
Core SDK
Category

Getters

Exported names

pdfGetAllocBy

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.