Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sizeof

Calculate the Size of Datatypes


Description

Calculate the number of bytes in an R data type used by mmap.

Usage

sizeof(type)

Arguments

type

A type constructor (function), R atomic, or mmap Ctype.

Details

A constructor for the purposes of sizeof is a function object used to create an atomic type for R or mmap. These include the base atomic type functions such as integer, character, double, numeric, single, complex and similar. In addition, the Ctype constructors in mmap such as int8, uint8, real32, etc may be passed in.

More typically a representative object of the above types can be passed in to determine the appropriate data size.

The purpose of this function is for use to help construct a proper offset argument value for mmap and mprotect, though neither use is common or encouraged since alignment to pagesize is required from the system call.

Value

Numeric bytes used.

Author(s)

Jeffrey A. Ryan

See Also

Examples

# all are equal

sizeof(int32)
sizeof(int32())
sizeof(integer)
sizeof(integer())
sizeof(1L)

mmap

Map Pages of Memory

v0.6-19
GPL-3
Authors
Jeffrey A. Ryan
Initial release
2020-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.