Skip to content

Commit

Permalink
Merge pull request #21051 from keithc-ca/j9sprintf
Browse files Browse the repository at this point in the history
Improve definition of j9str_printf()
  • Loading branch information
pshipton authored Feb 1, 2025
2 parents 337cedb + 8721c4e commit 0ab22ee
Show file tree
Hide file tree
Showing 90 changed files with 554 additions and 582 deletions.
4 changes: 2 additions & 2 deletions runtime/bcutil/ROMClassBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ ROMClassBuilder::handleAnonClassName(J9CfrClassFile *classfile, ROMClassCreation
* 0x<romAddress> will be appended to anon/hidden class name.
* Initialize the 0x<romAddress> part to 0x00000000 or 0x0000000000000000 (depending on the platforms).
*/
j9str_printf(PORTLIB, buf, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, 0);
j9str_printf(buf, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, 0);
memcpy(constantPool[newUtfCPEntry].bytes + newHostPackageLength + originalStringLength + 1, buf, ROM_ADDRESS_LENGTH + 1);

/* Mark if the class is a Lambda class. */
Expand Down Expand Up @@ -900,7 +900,7 @@ ROMClassBuilder::prepareAndLaydown( BufferManager *bufferManager, ClassFileParse
* write the name into a buffer first because j9str_printf automatically adds a NULL terminator
* at the end, and J9UTF8 are not NULL terminated
*/
j9str_printf(PORTLIB, message, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, (UDATA)romClassBuffer);
j9str_printf(message, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, (UDATA)romClassBuffer);
nameString = (char*) message;
}
memcpy((char*) (classNameBytes + classNameRealLenghth), nameString, ROM_ADDRESS_LENGTH);
Expand Down
4 changes: 2 additions & 2 deletions runtime/bcutil/ROMClassCreationContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ class ROMClassCreationContext
*/
nlsMessage = OMRPORT_FROM_J9PORT(PORTLIB)->nls_lookup_message(OMRPORT_FROM_J9PORT(PORTLIB), J9NLS_DO_NOT_PRINT_MESSAGE_TAG | J9NLS_DO_NOT_APPEND_NEWLINE, module_name, message_num, NULL);
if(NULL != nlsMessage) {
UDATA messageLength = j9str_printf(PORTLIB, NULL, 0, nlsMessage, memberNameLength, memberName, classNameLength, className);
UDATA messageLength = j9str_printf(NULL, 0, nlsMessage, memberNameLength, memberName, classNameLength, className);
U_8* message = (U_8*)j9mem_allocate_memory(messageLength, OMRMEM_CATEGORY_VM);
if(NULL != message) {
j9str_printf(PORTLIB, (char*)message, messageLength, nlsMessage, memberNameLength, memberName, classNameLength, className);
j9str_printf((char *)message, messageLength, nlsMessage, memberNameLength, memberName, classNameLength, className);
recordCFRError(message);
}
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/bcutil/defineclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,13 +1014,13 @@ createErrorMessage(J9VMThread *vmStruct, J9ROMClass *anonROMClass, J9ROMClass *h
}
}

bufLen = j9str_printf(PORTLIB, NULL, 0, errorMsg,
bufLen = j9str_printf(NULL, 0, errorMsg,
hostClassNameLength, hostClassNameData,
anonClassNameLength, anonClassNameData);
if (bufLen > 0) {
buf = j9mem_allocate_memory(bufLen, OMRMEM_CATEGORY_VM);
if (NULL != buf) {
j9str_printf(PORTLIB, buf, bufLen, errorMsg,
j9str_printf(buf, bufLen, errorMsg,
hostClassNameLength, hostClassNameData,
anonClassNameLength, anonClassNameData);
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/bcutil/jimageintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ jimageFindResource(J9JImageIntf *jimageIntf, UDATA handle, const char *moduleNam
IDATA resourceNameLen = 1 + strlen(moduleName) + 1 + strlen(name) + 1; /* +1 for preceding '/' and, +1 for '/' between module and resource name, and +1 for \0 character */
char *resourceName = j9mem_allocate_memory(resourceNameLen, J9MEM_CATEGORY_CLASSES);
if ((NULL != j9jimageLocation) && (NULL != resourceName)) {
j9str_printf(PORTLIB, resourceName, resourceNameLen, "/%s/%s", moduleName, name);
j9str_printf(resourceName, resourceNameLen, "/%s/%s", moduleName, name);
rc = j9bcutil_lookupJImageResource(PORTLIB, jimage, j9jimageLocation, resourceName);
j9mem_free_memory(resourceName);
if (J9JIMAGE_NO_ERROR == rc) {
Expand Down
12 changes: 6 additions & 6 deletions runtime/bcutil/jimagereader.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ j9bcutil_loadJImage(J9PortLibrary *portlib, const char *fileName, J9JImage **pji
memset(jimage, 0, sizeof(J9JImage));
jimage->fd = jimagefd;
jimage->fileName = (char *)(jimage + 1);
j9str_printf(PORTLIB, jimage->fileName, fileNameLen + 1, "%s", fileName);
j9str_printf(jimage->fileName, fileNameLen + 1, "%s", fileName);
jimage->fileLength = fileSize;
j9jimageHeader = jimage->j9jimageHeader = (J9JImageHeader *)((U_8 *)jimage + sizeof(J9JImage) + (fileNameLen + 1));

Expand Down Expand Up @@ -703,20 +703,20 @@ j9bcutil_getJImageResourceName(J9PortLibrary *portlib, J9JImage *jimage, const c
cursor = fullName;
spaceLeft = fullNameLen;
if (NULL != module) {
count = j9str_printf(PORTLIB, cursor, spaceLeft, "/%s/", module);
count = j9str_printf(cursor, spaceLeft, "/%s/", module);
cursor += count;
spaceLeft -= count;
}
if (NULL != parent) {
count = j9str_printf(PORTLIB, cursor, spaceLeft, "%s/", parent);
count = j9str_printf(cursor, spaceLeft, "%s/", parent);
cursor += count;
spaceLeft -= count;
}
count = j9str_printf(PORTLIB, cursor, spaceLeft, "%s", base);
count = j9str_printf(cursor, spaceLeft, "%s", base);
cursor += count;
spaceLeft -= count;
if (NULL != extension) {
count = j9str_printf(PORTLIB, cursor, spaceLeft, ".%s", extension);
count = j9str_printf(cursor, spaceLeft, ".%s", extension);
}

*resourceName = fullName;
Expand Down Expand Up @@ -761,7 +761,7 @@ j9bcutil_findModuleForPackage(J9PortLibrary *portlib, J9JImage *jimage, const ch
goto _end;
}

j9str_printf(PORTLIB, packageName, packageNameLen, "%s", packagePrefix);
j9str_printf(packageName, packageNameLen, "%s", packagePrefix);

for (i = 0; i <= strlen(package); i++) { /* include '\0' character as well */
/* convert any '/' to '.' */
Expand Down
4 changes: 2 additions & 2 deletions runtime/bcutil/test/dyntest/testHelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ deleteControlDirectory(struct J9PortLibrary *portLibrary, char* baseDir) {
UDATA handle, rc;
char mybaseFilePath[J9SH_MAXPATH];

j9str_printf(PORTLIB, mybaseFilePath, J9SH_MAXPATH, "%s/*", baseDir);
j9str_printf(mybaseFilePath, J9SH_MAXPATH, "%s/*", baseDir);
rc = handle = j9file_findfirst(mybaseFilePath, resultBuffer);
while (-1 != rc) {
j9file_unlink(resultBuffer);
Expand All @@ -386,4 +386,4 @@ deleteControlDirectory(struct J9PortLibrary *portLibrary, char* baseDir) {
}
j9file_unlinkdir(baseDir);
}
}
}
6 changes: 3 additions & 3 deletions runtime/bcverify/vrfyhelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,14 +850,14 @@ j9bcv_createVerifyErrorString(J9PortLibrary * portLib, J9BytecodeVerificationDat
J9UTF8 * romMethodSignatureString = J9ROMMETHOD_SIGNATURE(error->romMethod);

if (NULL == error->errorSignatureString) {
errStrLength = j9str_printf(PORTLIB, (char*) verifyError, stringLength, formatString, errorString,
errStrLength = j9str_printf((char *)verifyError, stringLength, formatString, errorString,
(U_32) J9UTF8_LENGTH(romClassName), J9UTF8_DATA(romClassName),
(U_32) J9UTF8_LENGTH(romMethodName), J9UTF8_DATA(romMethodName),
(U_32) J9UTF8_LENGTH(romMethodSignatureString), J9UTF8_DATA(romMethodSignatureString),
error->errorPC);
} else {
/* Jazz 82615: Print the corresponding NLS message to buffer for type mismatch error */
errStrLength = j9str_printf(PORTLIB, (char*) verifyError, stringLength, formatString, errorString,
errStrLength = j9str_printf((char *)verifyError, stringLength, formatString, errorString,
(U_32) J9UTF8_LENGTH(romClassName), J9UTF8_DATA(romClassName),
(U_32) J9UTF8_LENGTH(romMethodName), J9UTF8_DATA(romMethodName),
(U_32) J9UTF8_LENGTH(romMethodSignatureString), J9UTF8_DATA(romMethodSignatureString),
Expand All @@ -870,7 +870,7 @@ j9bcv_createVerifyErrorString(J9PortLibrary * portLib, J9BytecodeVerificationDat

/* Jazz 82615: Print the error message framework to the existing error buffer */
if (detailedErrMsgLength > 0) {
j9str_printf(PORTLIB, (char*)&verifyError[errStrLength], stringLength - errStrLength, "%.*s", detailedErrMsgLength, detailedErrMsg);
j9str_printf((char *)&verifyError[errStrLength], stringLength - errStrLength, "%.*s", detailedErrMsgLength, detailedErrMsg);
}
}

Expand Down
6 changes: 3 additions & 3 deletions runtime/cfdumper/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,9 +2833,9 @@ processJImageResource(const char *jimageFileName, J9JImage *jimage, J9JImageLoca

/* skip leading '/' if present */
if ('/' == resourceName[0]) {
j9str_printf(PORTLIB, tempPath, EsMaxPath, "%s", resourceName + 1);
j9str_printf(tempPath, EsMaxPath, "%s", resourceName + 1);
} else {
j9str_printf(PORTLIB, tempPath, EsMaxPath, "%s", resourceName);
j9str_printf(tempPath, EsMaxPath, "%s", resourceName);
}
current = strchr(tempPath, jimageFileSeparator);
while (NULL != current) {
Expand Down Expand Up @@ -3220,7 +3220,7 @@ static I_32 processROMClass(J9ROMClass* romClass, char* requestedFile, U_32 flag
length = (((length & 0xFF00) >> 8) | (length & 0x00FF) << 8);
}

j9str_printf(PORTLIB, tempPath, EsMaxPath, "%.*s", length, romClassName);
j9str_printf(tempPath, EsMaxPath, "%.*s", length, romClassName);
current = strchr(tempPath, DIR_SEPARATOR);
while (NULL != current) {
*current = '\0';
Expand Down
54 changes: 27 additions & 27 deletions runtime/cfdumper/romdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ escapeUTF8(J9PortLibrary *portLib, J9UTF8 *utf8, char *str, size_t strSize)
break;
}

escapedLength = j9str_printf(PORTLIB, str, strSize, "\\u%04x", (UDATA)c);
escapedLength = j9str_printf(str, strSize, "\\u%04x", (UDATA)c);
} else {
escapedLength = j9str_printf(PORTLIB, str, strSize, "%c", (char)c);
escapedLength = j9str_printf(str, strSize, "%c", (char)c);
}

strSize -= (size_t)escapedLength;
Expand Down Expand Up @@ -456,35 +456,35 @@ getRegionValueString(J9PortLibrary *portLib, J9ROMClass *romClass, J9ROMClassReg

switch (region->type) {
case J9ROM_U8:
j9str_printf(PORTLIB, str, strSize, "%12u", *(U_8 *)fieldPtr);
j9str_printf(str, strSize, "%12u", *(U_8 *)fieldPtr);
return;
case J9ROM_U16:
j9str_printf(PORTLIB, str, strSize, "%12u", *(U_16 *)fieldPtr);
j9str_printf(str, strSize, "%12u", *(U_16 *)fieldPtr);
return;
case J9ROM_U32:
j9str_printf(PORTLIB, str, strSize, "%12u", *(U_32 *)fieldPtr);
j9str_printf(str, strSize, "%12u", *(U_32 *)fieldPtr);
return;
case J9ROM_U64:
j9str_printf(PORTLIB, str, strSize, "%12llu", *(U_64 *)fieldPtr);
j9str_printf(str, strSize, "%12llu", *(U_64 *)fieldPtr);
return;
case J9ROM_UTF8:
j9str_printf(PORTLIB, str, strSize, "(UTF-8)");
j9str_printf(str, strSize, "(UTF-8)");
return;
case J9ROM_SRP:
j9str_printf(PORTLIB, str, strSize, "0x%08x", *(J9SRP *)fieldPtr);
j9str_printf(str, strSize, "0x%08x", *(J9SRP *)fieldPtr);
return;
case J9ROM_WSRP:
j9str_printf(PORTLIB, str, strSize, "0x%08x", *(J9WSRP *)fieldPtr);
j9str_printf(str, strSize, "0x%08x", *(J9WSRP *)fieldPtr);
return;
case J9ROM_SECTION_END:
j9str_printf(PORTLIB, str, strSize, "(SECTION)");
j9str_printf(str, strSize, "(SECTION)");
return;
case J9ROM_INTERMEDIATECLASSDATA:
j9str_printf(PORTLIB, str, strSize, "");
j9str_printf(str, strSize, "");
return;
}

j9str_printf(PORTLIB, str, strSize, "<error>");
j9str_printf(str, strSize, "<error>");
}

static void
Expand Down Expand Up @@ -522,7 +522,7 @@ getRegionDetailString(J9PortLibrary *portLib, J9ROMClassGatherLayoutInfoState *s
}

if (rangeValid) {
UDATA length = j9str_printf(PORTLIB, str, strSize, " -> ");
UDATA length = j9str_printf(str, strSize, " -> ");

escapeUTF8(PORTLIB, utf8, str + length, strSize - length);
printedUTF8 = TRUE;
Expand All @@ -534,16 +534,16 @@ getRegionDetailString(J9PortLibrary *portLib, J9ROMClassGatherLayoutInfoState *s
U_8 *addr = SRP_PTR_GET((J9SRP*)fieldPtr, U_8*);

if (NULL != addr) {
j9str_printf(PORTLIB, str, strSize, " -> 0x%p%s", (UDATA)addr - (UDATA)romClass,
j9str_printf(str, strSize, " -> 0x%p%s", (UDATA)addr - (UDATA)romClass,
((UDATA)addr - (UDATA)romClass) > romClass->romSize ? " (external)" : "");
}
}
} else if (J9ROM_INTERMEDIATECLASSDATA == region->type) {
j9str_printf(PORTLIB, str, strSize, " %5d bytes !j9x 0x%p,0x%p", region->length, base + region->offset, region->length);
j9str_printf(str, strSize, " %5d bytes !j9x 0x%p,0x%p", region->length, base + region->offset, region->length);
}

if (J9ROM_SECTION_END == region->type) {
j9str_printf(PORTLIB, str, strSize, " %5d bytes", region->length);
j9str_printf(str, strSize, " %5d bytes", region->length);
}
}

Expand Down Expand Up @@ -611,7 +611,7 @@ j9bcutil_linearDumpROMClass(J9PortLibrary *portLib, J9ROMClass *romClass, void *
lastOffset = region->offset;
}
if (nesting < nestingThreshold) {
j9str_printf(PORTLIB, buf, sizeof(buf), "Section Start: %s (%d bytes)", region->name, region->length);
j9str_printf(buf, sizeof(buf), "Section Start: %s (%d bytes)", region->name, region->length);
j9tty_printf(PORTLIB, "=== %-59s ===\n", buf);
}
nesting++;
Expand All @@ -623,7 +623,7 @@ j9bcutil_linearDumpROMClass(J9PortLibrary *portLib, J9ROMClass *romClass, void *
reportSuspectedPadding(portLib, romClass, &state, lastOffset, region->offset, base);
}
}
j9str_printf(PORTLIB, buf, sizeof(buf), "Section End: %s", region->name);
j9str_printf(buf, sizeof(buf), "Section End: %s", region->name);
j9tty_printf(PORTLIB, "=== %-59s ===\n", buf);
} else if (nesting == nestingThreshold) {
printRegionLine(portLib, &state, romClass, region, base - region->length);
Expand Down Expand Up @@ -811,12 +811,12 @@ j9bcutil_queryROMClass(J9PortLibrary *portLib, J9ROMClass *romClass, void *baseA
char buf[256];

if (J9ROM_SECTION_START == region->type) {
j9str_printf(PORTLIB, buf, sizeof(buf), "Section Start: %s (%d bytes)", region->name, region->length);
j9str_printf(buf, sizeof(buf), "Section Start: %s (%d bytes)", region->name, region->length);
j9tty_printf(PORTLIB, "=== %-59s ===\n", buf);
nesting++;
} else if (J9ROM_SECTION_END == region->type) {
nesting--;
j9str_printf(PORTLIB, buf, sizeof(buf), "Section End: %s", region->name);
j9str_printf(buf, sizeof(buf), "Section End: %s", region->name);
j9tty_printf(PORTLIB, "=== %-59s ===\n", buf);
if (0 == nesting) {
queryMatched = TRUE;
Expand Down Expand Up @@ -911,31 +911,31 @@ getRegionValueStringXML(J9PortLibrary *portLib, J9ROMClass *romClass, J9ROMClass

switch (region->type) {
case J9ROM_U8:
j9str_printf(PORTLIB, str, strSize, "%u", *(U_8 *)fieldPtr);
j9str_printf(str, strSize, "%u", *(U_8 *)fieldPtr);
return;
case J9ROM_U16:
j9str_printf(PORTLIB, str, strSize, "%u", *(U_16 *)fieldPtr);
j9str_printf(str, strSize, "%u", *(U_16 *)fieldPtr);
return;
case J9ROM_U32:
j9str_printf(PORTLIB, str, strSize, "%u", *(U_32 *)fieldPtr);
j9str_printf(str, strSize, "%u", *(U_32 *)fieldPtr);
return;
case J9ROM_U64:
j9str_printf(PORTLIB, str, strSize, "%llu", *(U_64 *)fieldPtr);
j9str_printf(str, strSize, "%llu", *(U_64 *)fieldPtr);
return;
case J9ROM_UTF8: {
J9UTF8 *utf8 = fieldPtr;
escapeUTF8(PORTLIB, utf8, str, strSize);
return;
}
case J9ROM_SRP:
j9str_printf(PORTLIB, str, strSize, "0x%08x", *(J9SRP *)fieldPtr);
j9str_printf(str, strSize, "0x%08x", *(J9SRP *)fieldPtr);
return;
case J9ROM_WSRP:
j9str_printf(PORTLIB, str, strSize, "0x%08x", *(J9WSRP *)fieldPtr);
j9str_printf(str, strSize, "0x%08x", *(J9WSRP *)fieldPtr);
return;
}

j9str_printf(PORTLIB, str, strSize, "error>");
j9str_printf(str, strSize, "error>");
}

void
Expand Down
4 changes: 2 additions & 2 deletions runtime/codert_vm/jswalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ static void walkJITFrameSlots(J9StackWalkState * walkState, U_8 * jitDescription
{
#ifdef J9VM_INTERP_STACKWALK_TRACING
PORT_ACCESS_FROM_WALKSTATE(walkState);
j9str_printf(PORTLIB, indexedTag, 64, "O-Slot: %s%d", slotDescription, slotsRemaining - 1);
j9str_printf(indexedTag, 64, "O-Slot: %s%d", slotDescription, slotsRemaining - 1);
WALK_NAMED_O_SLOT((j9object_t*) scanCursor, indexedTag);
#else
WALK_O_SLOT((j9object_t*) scanCursor);
Expand All @@ -650,7 +650,7 @@ static void walkJITFrameSlots(J9StackWalkState * walkState, U_8 * jitDescription
{
#ifdef J9VM_INTERP_STACKWALK_TRACING
PORT_ACCESS_FROM_WALKSTATE(walkState);
j9str_printf(PORTLIB, indexedTag, 64, "I-Slot: %s%d", slotDescription, slotsRemaining - 1);
j9str_printf(indexedTag, 64, "I-Slot: %s%d", slotDescription, slotsRemaining - 1);
WALK_NAMED_I_SLOT(scanCursor, indexedTag);
#else
WALK_I_SLOT(scanCursor);
Expand Down
2 changes: 1 addition & 1 deletion runtime/exelib/common/libhlp.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ char * vmDetailString( J9PortLibrary *portLib, char *detailString, UDATA detailS
osversion = j9sysinfo_get_OS_version();
osarch = j9sysinfo_get_CPU_architecture();

j9str_printf (PORTLIB, detailString, detailStringLength, "%s (%s %s %s)", EsBuildVersionString, ostype ? ostype : "unknown", osversion ? osversion : "unknown", osarch ? osarch : "unknown");
j9str_printf(detailString, detailStringLength, "%s (%s %s %s)", EsBuildVersionString, ostype ? ostype : "unknown", osversion ? osversion : "unknown", osarch ? osarch : "unknown");
return detailString;
}

Expand Down
10 changes: 5 additions & 5 deletions runtime/gc_modron_startup/mminit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ j9gc_initialize_heap(J9JavaVM *vm, IDATA *memoryParameterTable, UDATA heapBytesR

char *buffer = (char *)j9mem_allocate_memory(formatLength, OMRMEM_CATEGORY_MM);
if (NULL != buffer) {
j9str_printf(PORTLIB, buffer, formatLength, format, size, qualifier);
j9str_printf(buffer, formatLength, format, size, qualifier);
}
vm->internalVMFunctions->setErrorJ9dll(PORTLIB, loadInfo, buffer, TRUE);
break;
Expand All @@ -383,7 +383,7 @@ j9gc_initialize_heap(J9JavaVM *vm, IDATA *memoryParameterTable, UDATA heapBytesR

char *buffer = (char *)j9mem_allocate_memory(formatLength, OMRMEM_CATEGORY_MM);
if (NULL != buffer) {
j9str_printf(PORTLIB, buffer, formatLength, format, size, qualifier);
j9str_printf(buffer, formatLength, format, size, qualifier);
}
vm->internalVMFunctions->setErrorJ9dll(PORTLIB, loadInfo, buffer, TRUE);
break;
Expand All @@ -409,7 +409,7 @@ j9gc_initialize_heap(J9JavaVM *vm, IDATA *memoryParameterTable, UDATA heapBytesR

char *buffer = (char *)j9mem_allocate_memory(formatLength, OMRMEM_CATEGORY_MM);
if (NULL != buffer) {
j9str_printf(PORTLIB, buffer, formatLength, format, heapSize, heapSizeQualifier, pageSize, pageSizeQualifier);
j9str_printf(buffer, formatLength, format, heapSize, heapSizeQualifier, pageSize, pageSizeQualifier);
}
vm->internalVMFunctions->setErrorJ9dll(PORTLIB, loadInfo, buffer, TRUE);
extensions->largePageFailedToSatisfy = true;
Expand All @@ -435,11 +435,11 @@ j9gc_initialize_heap(J9JavaVM *vm, IDATA *memoryParameterTable, UDATA heapBytesR
UDATA newSpaceSize = extensions->newSpaceSize;
const char* newQualifier = NULL;
qualifiedSize(&newSpaceSize, &newQualifier);
UDATA formatLength = j9str_printf(PORTLIB, NULL, 0, format, splitFailure, newSpaceSize, newQualifier, oldSpaceSize, oldQualifier);
UDATA formatLength = j9str_printf(NULL, 0, format, splitFailure, newSpaceSize, newQualifier, oldSpaceSize, oldQualifier);

char *buffer = (char *)j9mem_allocate_memory(formatLength, OMRMEM_CATEGORY_MM);
if (NULL != buffer) {
j9str_printf(PORTLIB, buffer, formatLength, format, splitFailure, newSpaceSize, newQualifier, oldSpaceSize, oldQualifier);
j9str_printf(buffer, formatLength, format, splitFailure, newSpaceSize, newQualifier, oldSpaceSize, oldQualifier);
}
vm->internalVMFunctions->setErrorJ9dll(PORTLIB, loadInfo, buffer, TRUE);
}
Expand Down
Loading

0 comments on commit 0ab22ee

Please sign in to comment.