﻿# rsize\_t

The 'rsize\_t' is an unsigned integer type and is very similar to the type [size\_t](https://pvs-studio.com/en/blog/terms/0044/)\.

The 'size\_t' type is a result of the 'sizeof' operator\. Variables of the 'size\_t' type are guaranteed to have enough capacity to store the size of any object or array of objects\. The largest value such a variable can store is SIZE\_MAX\. The 'size\_t' type can also be used to store an address\.

The 'rsize\_t' type is a synonym of 'size\_t' but it is designed to store the size of a single object\. In other words, by using the 'rsize\_t' type the programmer emphasizes that he is handling the size of one single object\. Its maximum size is specified by the RSIZE\_MAX constant\.

The RSIZE\_MAX constant can also be used to check the values of the arguments passed into a function: if a function receives an object size as one of the arguments, this value cannot be larger than RSIZE\_MAX\.

## References:

1. Terminology\. [size\_t](https://pvs-studio.com/en/blog/terms/0044/)\.
1. Andrey Karpov\. [About size\_t and ptrdiff\_t](https://pvs-studio.com/en/blog/posts/cpp/a0050/)\.