13 October 2023, 16:59 | #21 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,231
|
There are good reasons to use RawDoFmt(), and one of them is that it is localizable, such that the output is compatible to the conventions of the locale. Argument reordering is particularly useful when localizing applications.
As said, in most cases, this patch from locale does only good. There are some rare cases we you need to avoid it, and this is if stack is sparse or the Os is not in a stable state. |
13 October 2023, 21:47 | #22 | |
Registered User
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 924
|
Quote:
|
|
14 October 2023, 08:37 | #23 | |
Registered User
Join Date: Jul 2022
Location: Australia
Posts: 49
|
Quote:
Cheers, -Matt |
|
14 October 2023, 09:17 | #24 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
The overhead of preparing for positional arguments such as "%2$s" was significant and hard to ignore once you saw it. As a preview of what will likely land in NDK 3.2R4, here is an excerpt from the "WARNING" section attached to the exec.library/RawDoFmt function (equivalent warnings have been added to the locale.library and dos.library Autodocs): Code:
The "locale.library" (introduced with Workbench 2.1) will install its own replacement sprintf()-like formatting code via SetFunction(). This replacement has significantly higher stack size requirements than the original exec.library version of RawDoFmt(). You are best advised to only call RawDoFmt(), even indirectly such as through the dos.library/VPrintf function, if there are more than 1000 bytes of stack space available. The stack size requirements apply to all locale.library versions up to and including V46.8 (AmigaOS 3.1.4), which all default to prepare for positional arguments such as "%2$s", regardless of whether these are used in the format specification string. Starting with locale.library V47.26 (AmigaOS 3.2) will prepare for positional arguments only if the format specification string calls for it. As a general precaution, you should always assume that preparations for positional arguments are being made. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Diagrom Serial Output garbled | avinitlarge | support.Hardware | 6 | 29 December 2021 13:24 |
Two different serial numbers | TCH | support.Hardware | 6 | 10 July 2021 19:00 |
Serial output in WinUAE 3.3 - how to? | DarrenHD | support.WinUAE | 3 | 16 June 2016 21:41 |
PC Serial to Amiga Serial | lesta_smsc | support.Hardware | 48 | 02 December 2015 10:14 |
Sending debug output to the serial port OS3.x | NovaCoder | Coders. C/C++ | 0 | 18 February 2013 06:56 |
|
|