Class ShadowNativeAllocationRegistry

java.lang.Object
org.robolectric.shadows.ShadowNativeAllocationRegistry

@Implements(value=libcore.util.NativeAllocationRegistry.class, minSdk=26, isInAndroidSdk=false, shadowPicker=Picker.class, callNativeMethodsByDefault=true) public class ShadowNativeAllocationRegistry extends Object
Shadow for NativeAllocationRegistry that is backed by native code
  • Field Details

    • realNativeAllocationRegistry

      @RealObject protected libcore.util.NativeAllocationRegistry realNativeAllocationRegistry
  • Constructor Details

    • ShadowNativeAllocationRegistry

      public ShadowNativeAllocationRegistry()
  • Method Details

    • __constructor__

      @InDevelopment @Implementation(minSdk=35) protected void __constructor__(ClassLoader classLoader, Class clazz, long freeFunction, long size, boolean mallocAllocation)
      The newly introduced constructor (in version V) now performs a null check on the classLoader argument. We intercept the constructor calls so as to pass a non-null classloader. The classloader would be Robolectric's SandboxClassloader, but the value itself does not affect the behavior of actual class.
    • registerNativeAllocation

      @Implementation protected Runnable registerNativeAllocation(Object referent, long nativePtr)
    • applyFreeFunction

      @Implementation(maxSdk=34) protected static void applyFreeFunction(long freeFunction, long nativePtr)