View source: R/safety_checks.R
| validate_allocation_size | R Documentation |
Given dimension sizes and bytes per element, checks that the total allocation size is safe. Catches negative/NA/Inf dimensions, integer overflow (by converting to double), and enforces the max allocation limit.
validate_allocation_size(
dims,
bytes_per_elem,
max_bytes = get_max_alloc_bytes()
)
dims |
numeric vector of dimension sizes (e.g., |
bytes_per_elem |
single numeric value, the number of bytes per element
(e.g., |
max_bytes |
single numeric value, the maximum allowed allocation in bytes.
Defaults to the result of |
the total number of elements (as double), invisibly. The function stops with an error if the allocation would be unsafe.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.