mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-23 06:07:06 +00:00
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:
+2
-2
@@ -461,7 +461,7 @@ static void writeMapBank(SortedSections const §List, SectionType type, uint3
|
||||
fprintf(
|
||||
mapFile,
|
||||
"\n%s bank #%" PRIu32 ":\n",
|
||||
sectionTypeInfo[type].name.c_str(),
|
||||
sectionTypeInfo[type].name,
|
||||
bank + sectionTypeInfo[type].firstBank
|
||||
);
|
||||
|
||||
@@ -524,7 +524,7 @@ static void writeMapSummary() {
|
||||
fprintf(
|
||||
mapFile,
|
||||
"\t%s: %" PRIu32 " byte%s used / %zu free",
|
||||
sectionTypeInfo[type].name.c_str(),
|
||||
sectionTypeInfo[type].name,
|
||||
usedTotal,
|
||||
usedTotal == 1 ? "" : "s",
|
||||
static_cast<size_t>(nbBanks) * sectionTypeInfo[type].size - usedTotal
|
||||
|
||||
Reference in New Issue
Block a user