Instead of allocating a single 0 char, set the char * DNA pointer to
null. This avoids the overhead of allocating and copying single-bytes.
rBeed45b655c9f didn't do this for safety reasons, but I checked the
existing uses of this behavior in DNA/RNA. Out of 43 total char *
members, this change only affects 7 recently added properties.
For a complete list, see the patch description.
There are 43 total char * members in DNA*types.h files (including const char *). Here I'll categorize them:
- Affected by change (Exposed to RNA with no custom get and set), null checks everywhere: SpreadsheetRowFilter::value_string, NodeInputString::string, bNodeSocket::default_attribute_name, Curves::surface_uv_map
- Affected by change (Exposed to RNA with no custom get and set), null checks in most places: SpreadsheetContextNode::node_name, SpreadsheetContextModifier::modifier_name, SpreadsheetColumnID::name
- Exposed to RNA with custom get and set, does use null: TextLine::format, NodeCryptomatte::matte_id, ShaderNodeScript::bytecode, TexPaintSlot::uvname, Curve::str, AssetMetaData::author, AssetMetaData::description, KS_Path::rna_path, FCurve::rna_path, DriverTarget::rna_path
- Exposed to RNA with custom get and set, does not use null: Text::filepath, TextLine::line, ConsoleLine::line
- Exposed to RNA with custom get, no set: FileDirEntry::relpath, FileDirEntry::name, TexPaintSlot::attribute_name
- Not exposed to RNA, runtime data: WorkSpace::status_text, Report::typestr, Report::message, FileDirEntry::redirection_path, ShaderFxData::error, ARegion::headerstr, SpreadsheetColumn::display_name, ARegion_Runtime::category, ModifierData::error, GpencilModifierData::error, AnimOverride::rna_path
- Not exposed to RNA, other: RE_engine_id_BLENDER_EEVEE, RE_engine_id_BLENDER_WORKBENCH, RE_engine_id_CYCLES, SDNA::data, PointCache::cached_frames, Object::matbits, LightCacheTexture::data
- Totally unused: uiList::custom_drag_opname, uiList::custom_activate_opname