-
Notifications
You must be signed in to change notification settings - Fork 1
Implementation Decisions
For fundamental integer types, Castor implements the LP64 data model. Below is a list of fundamental integer types, their bit widths, their corresponding sizeof, and their range:
| Integer Type | Bit Width | sizeof |
Range |
|---|---|---|---|
char |
8 | 1 | -128 to 127 |
short int |
16 | 2 | -32768 to 32767 |
int |
32 | 4 | -2147483648 to 2147483647 |
long int |
64 | 8 | -9223372036854775808 to 9223372036854775807 |
long long int |
64 | 8 | -9223372036854775808 to 9223372036854775807 |
signed char |
8 | 1 | -128 to 127 |
signed short int |
16 | 2 | -32768 to 32767 |
signed int |
32 | 4 | -2147483648 to 2147483647 |
signed long int |
64 | 8 | -9223372036854775808 to 9223372036854775807 |
signed long long int |
64 | 8 | -9223372036854775808 to 9223372036854775807 |
unsigned char |
8 | 1 | 0 to 255 |
unsigned short int |
16 | 2 | 0 to 65535 |
unsigned int |
32 | 4 | 0 to 4294967295 |
unsigned long int |
64 | 8 | 0 to 18446744073709551615 |
unsigned long long int |
64 | 8 | 0 to 18446744073709551615 |
wchar_t |
8 | 1 | 0 to 255 |
char16_t |
16 | 2 | 0 to 65535 |
char32_t |
32 | 4 | 0 to 4294967295 |
Pointer types have been implemented as unbounded, unsigned integers. This decision was made to eliminate problems with pointer overflow and out-of-memory issues in the underlying theory.
Castor-defined replacements for system headers will occasionally define new data types. Below is a list of these data types, as well as the primitive type they alias:
| Header Type | Aliased Type |
|---|---|
ptrdiff_t |
long long int |
size_t |
unsigned long long int |
nullptr_t |
decltype(nullptr) |
int8_t |
char |
int16_t |
short int |
int32_t |
int |
int64_t |
long long int |
int_fast8_t |
int8_t |
int_fast16_t |
int16_t |
int_fast32_t |
int32_t |
int_fast64_t |
int64_t |
int_least8_t |
int8_t |
int_least16_t |
int16_t |
int_least32_t |
int32_t |
int_least64_t |
int64_t |
intmax_t |
int64_t |
intptr_t |
int64_t |
uint8_t |
unsigned char |
uint16_t |
unsigned short int |
uint32_t |
unsigned int |
uint64_t |
unsigned long long int |
uint_fast8_t |
uint8_t |
uint_fast16_t |
uint16_t |
uint_fast32_t |
uint32_t |
uint_fast64_t |
uint64_t |
uint_least8_t |
uint8_t |
uint_least16_t |
uint16_t |
uint_least32_t |
uint32_t |
uint_least64_t |
uint64_t |
uintmax_t |
uint64_t |
uintptr_t |
uint64_t |
Function parameters are evaluated right-to-left. In the case of a member function call expression.foo(...), expression is evaluated before any of the parameters. Therefore, per the C++ standard, expression.foo(args1...).bar(args2...) evaluates expression first, then args1 right-to-left, then foo, then args2 right-to-left, then bar.
This software manual is released as LLNL-SM-2018190.
This document was prepared as an account of work sponsored by an agency of the United States government. Neither the United States government nor Lawrence Livermore National Security, LLC, nor any of their employees makes any warranty, expressed or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes.
This work performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
This document is released as LLNL-SM-2018190.