OpenCorePkg/User/Include/UserMemory.h
Savva Mitrofanov 5c2c72febc User: Add pool allocation size configurable limits for UserBaseMemoryLib
To improve for example handling of OOM-states during fuzzing we provides
options to limit maximum size of single allocation operation. Extends
checks for Free operations and integer underflow/overflow handling.
2022-11-25 20:55:14 +06:00

28 lines
558 B
C

/** @file
Copyright (c) 2022, vit9696. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
**/
#ifndef USER_MEMORY_H
#define USER_MEMORY_H
//
// Limits single pool allocation size to 512MB by default.
//
extern UINTN mPoolAllocationSizeLimit;
extern UINTN mPoolAllocations;
extern UINTN mPageAllocations;
extern UINT64 mPoolAllocationMask;
extern UINTN mPoolAllocationIndex;
extern UINT64 mPageAllocationMask;
extern UINTN mPageAllocationIndex;
VOID
SetPoolAllocationSizeLimit (
UINTN AllocationSize
);
#endif // USER_MEMORY_H