MCPcopy Create free account
hub / github.com/apache/thrift / new_container_array

Function new_container_array

lib/rb/ext/struct.c:38–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36#define STRUCT_FIELDS(obj) rb_const_get(CLASS_OF(obj), fields_const_id)
37
38static VALUE new_container_array(int size) {
39 if (size < 0) {
40 rb_exc_raise(
41 get_protocol_exception(
42 INT2FIX(PROTOERR_NEGATIVE_SIZE),
43 rb_str_new2("Negative container size")
44 )
45 );
46 }
47
48 return rb_ary_new2(size > 1024 ? 1024 : size);
49}
50
51//-------------------------------------------
52// Writing section

Callers 1

read_anythingFunction · 0.85

Calls 1

get_protocol_exceptionFunction · 0.85

Tested by

no test coverage detected