Class FFM.FFMConfigBuilder
java.lang.Object
org.lwjgl.system.ffm.FFM.FFMConfigBuilder
- Enclosing class:
FFM
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the binding configuration instance.withChecks(boolean enabled) Enables or disables runtime checks.withCriticalOverride(Function<Method, @Nullable Boolean> criticalOverride) EnablesFFMCriticalannotation overriding.withDebugGenerator(boolean enabled) Enables or disables debug output.withFunctionProvider(FunctionProvider provider) Enables function pointer retrieval using aFunctionProvider.withNullableAnnotation(Class<? extends Annotation> annotation) withSymbolLookup(SymbolLookup lookup) Enables function pointer retrieval using aSymbolLookup.withTracing(TraceConsumer consumer) Enables function call tracing.withTracing(TraceConsumer consumer, Predicate<Method> filter) Enables function call tracing with filtering.
-
Method Details
-
withNullableAnnotation
-
withSymbolLookup
Enables function pointer retrieval using aSymbolLookup. -
withFunctionProvider
Enables function pointer retrieval using aFunctionProvider. -
withTracing
Enables function call tracing.- Parameters:
consumer- the trace consumer
-
withTracing
Enables function call tracing with filtering.- Parameters:
consumer- the trace consumerfilter- the filter that selects which methods will be instrumented for tracing. Optional.
-
withCriticalOverride
public FFM.FFMConfigBuilder withCriticalOverride(Function<Method, @Nullable Boolean> criticalOverride) EnablesFFMCriticalannotation overriding.Interfaces and methods may be statically configured with the
FFMCriticalannotation. This configuration is respected when no critical override is specified in theFFMConfig. When an override is specified:- If the override returns null for a method, the static configuration is respected.
- If the override returns
Boolean.TRUEfor a method,Linker.Option.critical(boolean)is forcibly enabled. - If the override returns
Boolean.FALSEfor a method,Linker.Option.critical(boolean)is forcibly disabled.
This override is useful when the static configuration is not appropriate in certain execution contexts. For example, when running an application with debug facilities enabled, functions that would normally never call back into Java may start doing so. This violates the critical function requirements. Conversely, functions that were not annotated as critical may be forcibly made critical in release builds of the application.
-
withChecks
Enables or disables runtime checks.Defaults to
Checks.CHECKS.- Parameters:
enabled- whether to enable runtime checks
-
withDebugGenerator
Enables or disables debug output.Defaults to
Configuration.DEBUG_GENERATOR.- Parameters:
enabled- whether to enable debug output
-
build
Builds the binding configuration instance.
-