On Wed, 26 Mar 2025 14:32:05 GMT, Daniel Gredler <dgred...@openjdk.org> wrote:

>> src/java.desktop/windows/native/libfontmanager/lcdglyph.c line 126:
>> 
>>> 124: 
>>> 125: JNIEXPORT void JNICALL Java_sun_font_FileFontStrike_initNative(JNIEnv 
>>> *env, jclass unused) {
>>> 126:     memset(igLUTable, 0, sizeof igLUTable);
>> 
>> This line was updated in https://github.com/openjdk/jdk/pull/9772 but I 
>> wonder if we actually need it? can we initialize it in the code above with = 
>> {0}? If that is possible we can drop this method completely.
>> BTW what is the default content of this global static array - zeros? I still 
>> prefer {0} for readability even if default is zero.
>
> I'll defer to you and Phil on this one. The existing code base seems to use 
> `memset` much more often than vanilla array init, even just for zeroes. I had 
> also assumed that we would want to keep `initNative`, rather than 
> initializing immediately, but I'm happy to eliminate it if my assumption was 
> wrong.
> 
> @prrace: Thoughts?

initNative used to do more .. it used to actually check whether it was XP or 
later .. somewhere along the line that functionality was removed. Probably the 
method can be removed. But you'd have to be sure the initializer works, and I'd 
need to run it through the test system.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24230#discussion_r2014670481

Reply via email to