Avoid allocating for our linkdef names (#2111)

This reverts a change introduced in fd78a9ae8, though it wasn't that commit's main point
so I'm feeling okay with undoing that.

This feels like an overkill change, using a static string is good enough for this
since we never modify this. I have considered using `string_view` instead, to have
the best of both worlds, but that's not NUL-terminated so our print functions
get a little grumpy.
This commit is contained in:
ISSOtm
2026-09-17 13:58:30 -04:00
committed by Rangi
parent 0b9f8ab523
commit f234796428
8 changed files with 31 additions and 38 deletions
+3 -5
View File
@@ -309,7 +309,7 @@ static void mergeSections(
sectError(
"Section \"%s\" already exists but with type `%s`",
sect.name.c_str(),
sect.typeInfo().name.c_str()
sect.typeInfo().name
);
}
@@ -433,7 +433,7 @@ static Section *getSection(
} else if (bank < typeInfo.firstBank || bank > typeInfo.lastBank) {
error(
"%s bank value $%04" PRIx32 " out of range ($%04" PRIx32 " to $%04" PRIx32 ")",
typeInfo.name.c_str(),
typeInfo.name,
bank,
typeInfo.firstBank,
typeInfo.lastBank
@@ -478,9 +478,7 @@ static Section *getSection(
alignment = 0; // Ignore it if it's satisfied
} else if (typeInfo.startAddr & alignMask) {
error(
"Section \"%s\"'s alignment cannot be attained in %s",
name.c_str(),
typeInfo.name.c_str()
"Section \"%s\"'s alignment cannot be attained in %s", name.c_str(), typeInfo.name
);
alignment = 0; // Ignore it if it's unattainable
org = 0;