Class FFM.FFMConfigBuilder

java.lang.Object
org.lwjgl.system.ffm.FFM.FFMConfigBuilder
Enclosing class:
FFM

public static final class FFM.FFMConfigBuilder extends Object
A builder class for FFMConfig.
  • Method Details

    • withNullableAnnotation

      public FFM.FFMConfigBuilder withNullableAnnotation(Class<? extends Annotation> annotation)
    • withSymbolLookup

      public FFM.FFMConfigBuilder withSymbolLookup(SymbolLookup lookup)
      Enables function pointer retrieval using a SymbolLookup.
    • withFunctionProvider

      public FFM.FFMConfigBuilder withFunctionProvider(FunctionProvider provider)
      Enables function pointer retrieval using a FunctionProvider.
    • withTracing

      public FFM.FFMConfigBuilder withTracing(TraceConsumer consumer)
      Enables function call tracing.
      Parameters:
      consumer - the trace consumer
    • withTracing

      public FFM.FFMConfigBuilder withTracing(TraceConsumer consumer, Predicate<Method> filter)
      Enables function call tracing with filtering.
      Parameters:
      consumer - the trace consumer
      filter - the filter that selects which methods will be instrumented for tracing. Optional.
    • withCriticalOverride

      public FFM.FFMConfigBuilder withCriticalOverride(Function<Method, @Nullable Boolean> criticalOverride)
      Enables FFMCritical annotation overriding.

      Interfaces and methods may be statically configured with the FFMCritical annotation. This configuration is respected when no critical override is specified in the FFMConfig. When an override is specified:

      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

      public FFM.FFMConfigBuilder withChecks(boolean enabled)
      Enables or disables runtime checks.

      Defaults to Checks.CHECKS.

      Parameters:
      enabled - whether to enable runtime checks
    • withDebugGenerator

      public FFM.FFMConfigBuilder withDebugGenerator(boolean enabled)
      Enables or disables debug output.

      Defaults to Configuration.DEBUG_GENERATOR.

      Parameters:
      enabled - whether to enable debug output
    • build

      public FFMConfig build()
      Builds the binding configuration instance.