| 113 | }; |
| 114 | |
| 115 | void ReleaseExportedSchema(struct ArrowSchema* schema) { |
| 116 | if (ArrowSchemaIsReleased(schema)) { |
| 117 | return; |
| 118 | } |
| 119 | for (int64_t i = 0; i < schema->n_children; ++i) { |
| 120 | struct ArrowSchema* child = schema->children[i]; |
| 121 | ArrowSchemaRelease(child); |
| 122 | DCHECK(ArrowSchemaIsReleased(child)) |
| 123 | << "Child release callback should have marked it released"; |
| 124 | } |
| 125 | struct ArrowSchema* dict = schema->dictionary; |
| 126 | if (dict != nullptr) { |
| 127 | ArrowSchemaRelease(dict); |
| 128 | DCHECK(ArrowSchemaIsReleased(dict)) |
| 129 | << "Dictionary release callback should have marked it released"; |
| 130 | } |
| 131 | DCHECK_NE(schema->private_data, nullptr); |
| 132 | delete reinterpret_cast<ExportedSchemaPrivateData*>(schema->private_data); |
| 133 | |
| 134 | ArrowSchemaMarkReleased(schema); |
| 135 | } |
| 136 | |
| 137 | template <typename SizeType> |
| 138 | Result<int32_t> DowncastMetadataSize(SizeType size) { |
nothing calls this directly
no test coverage detected