/// <summary>Allows the user to register a function that will get called when the module calls free().</summary> public static void ATFreeHookRegister(Foundation.Delegates.Action_IntPtr_ulong freeHook) { var _arg0 = freeHook == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(freeHook); _Internal.ATFreeHookRegister(_arg0); }
/// <summary>Initialize a new base array object with existing objects using the original buffer without copying</summary> /// <param name="array">The object to initialize. Can be `NULL` so the result from `ATBaseArrayNew` can be passed directly, in which case it will simply return `NULL`</param> /// <param name="existingObjects">A pointer to a buffer of existing object references</param> /// <param name="length">The length of the buffer (number of object references)</param> /// <param name="capacity">The capacity of the buffer (number of object references)</param> /// <param name="weak">If `true`, creates a weak array and does not retain objects</param> /// <param name="weakElementRemovedCallback">Only if weak is `true`, the callback to be called when an object is removed from the array because it was deallocated</param> /// <returns>The initialized object or `NULL` if initialization failed</returns> public static Foundation.ATBaseArrayUnsafe ATBaseArrayInitWithObjectsNoCopy(Foundation.ATBaseArrayUnsafe array, void **existingObjects, ulong length, ulong capacity, bool weak, Foundation.Delegates.Action_IntPtr_ulong weakElementRemovedCallback) { var _arg0 = ReferenceEquals(array, null) ? IntPtr.Zero : array._Instance; var _arg5 = weakElementRemovedCallback == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(weakElementRemovedCallback); var _ret = _Internal.ATBaseArrayInitWithObjectsNoCopy(_arg0, existingObjects, length, capacity, weak, _arg5); Foundation.ATBaseArrayUnsafe _result0; if (_ret == IntPtr.Zero) { _result0 = null; } else if (Foundation.ATBaseArrayUnsafe.NativeToManagedMap.ContainsKey(_ret)) { _result0 = (Foundation.ATBaseArrayUnsafe)Foundation.ATBaseArrayUnsafe.NativeToManagedMap[_ret]; } else { _result0 = Foundation.ATBaseArrayUnsafe._CreateInstance(_ret); } return(_result0); }