|
| void | CheckAllocationAllowed (size_t requested_size) |
| | Checks whether an allocation is allowed by the memory limit set for the script.
|
| |
| void * | DoAlloc (SQUnsignedInteger requested_size) |
| | Internal helper to allocate the given amount of bytes.
|
| |
|
| std::allocator< uint8_t > | allocator |
| |
| size_t | allocated_size = 0 |
| | Sum of allocated data size.
|
| |
| size_t | allocation_limit |
| | Maximum this allocator may use before allocations fail.
|
| |
| bool | error_thrown = false |
| | Whether the error has already been thrown, so to not throw secondary errors in the handling of the allocation error.
|
| |
|
| static const size_t | SAFE_LIMIT = 0x8000000 |
| | 128 MiB, a safe choice for almost any situation
|
| |
Definition at line 32 of file squirrel.cpp.
◆ ScriptAllocator()
| ScriptAllocator::ScriptAllocator |
( |
| ) |
|
|
inline |
◆ ~ScriptAllocator()
| ScriptAllocator::~ScriptAllocator |
( |
| ) |
|
|
inline |
◆ CheckAllocationAllowed()
| void ScriptAllocator::CheckAllocationAllowed |
( |
size_t |
requested_size | ) |
|
|
inlineprivate |
◆ CheckLimit()
| void ScriptAllocator::CheckLimit |
( |
| ) |
const |
|
inline |
◆ DoAlloc()
| void * ScriptAllocator::DoAlloc |
( |
SQUnsignedInteger |
requested_size | ) |
|
|
inlineprivate |
Internal helper to allocate the given amount of bytes.
- Parameters
-
| requested_size | The requested size. |
- Returns
- The allocated memory.
- Exceptions
-
Definition at line 78 of file squirrel.cpp.
◆ Free()
| void ScriptAllocator::Free |
( |
void * |
p, |
|
|
SQUnsignedInteger |
size |
|
) |
| |
|
inline |
◆ GetAllocatedSize()
| size_t ScriptAllocator::GetAllocatedSize |
( |
| ) |
const |
|
inline |
◆ Malloc()
| void * ScriptAllocator::Malloc |
( |
SQUnsignedInteger |
size | ) |
|
|
inline |
◆ Realloc()
| void * ScriptAllocator::Realloc |
( |
void * |
p, |
|
|
SQUnsignedInteger |
oldsize, |
|
|
SQUnsignedInteger |
size |
|
) |
| |
|
inline |
◆ Reset()
| void ScriptAllocator::Reset |
( |
| ) |
|
|
inline |
◆ Squirrel
◆ allocated_size
| size_t ScriptAllocator::allocated_size = 0 |
|
private |
◆ allocation_limit
| size_t ScriptAllocator::allocation_limit |
|
private |
◆ allocator
| std::allocator<uint8_t> ScriptAllocator::allocator |
|
private |
◆ error_thrown
| bool ScriptAllocator::error_thrown = false |
|
private |
Whether the error has already been thrown, so to not throw secondary errors in the handling of the allocation error.
This as the handling of the error will throw a Squirrel error so the Squirrel stack can be dumped, however that gets allocated by this allocator and then you might end up in an infinite loop.
Definition at line 45 of file squirrel.cpp.
◆ SAFE_LIMIT
| const size_t ScriptAllocator::SAFE_LIMIT = 0x8000000 |
|
staticprivate |
128 MiB, a safe choice for almost any situation
Definition at line 47 of file squirrel.cpp.
The documentation for this struct was generated from the following file: