MCPcopy Create free account
hub / github.com/apache/arrow / CastSize

Function CastSize

python/pyarrow/src/arrow/python/helpers.h:132–140  ·  view source on GitHub ↗

\brief Cast the given size to int32_t, with error checking

Source from the content-addressed store, hash-verified

130
131// \brief Cast the given size to int32_t, with error checking
132inline Status CastSize(Py_ssize_t size, int32_t* out,
133 const char* error_msg = "Maximum size exceeded (2GB)") {
134 // size is assumed to be positive
135 if (size > std::numeric_limits<int32_t>::max()) {
136 return Status::Invalid(error_msg);
137 }
138 *out = static_cast<int32_t>(size);
139 return Status::OK();
140}
141
142inline Status CastSize(Py_ssize_t size, int64_t* out, const char* error_msg = NULLPTR) {
143 // size is assumed to be positive

Callers

nothing calls this directly

Calls 2

InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected