//------------------------------------------------------------ VIREO_EXPORT StringRef TypeRef_ElementName(TypeManagerRef tm, TypeRef typeRef) { TypeManagerScope scope(tm); SubString name = typeRef->ElementName(); static StringRef returnBuffer = nullptr; if (returnBuffer == nullptr) { // Allocate a string the first time it is used. // After that it will be resized as needed. STACK_VAR(String, tempReturn); returnBuffer = tempReturn.DetachValue(); } else { returnBuffer->Resize1D(name.Length()); } if (returnBuffer) { returnBuffer->CopyFromSubString(&name); return returnBuffer; } return nullptr; }