#if NET7_0_OR_GREATER
using System.Runtime.InteropServices;
namespace Xdg.Directories.FFI;
internal static partial class Exports
{
///
/// Frees the specified pointer
///
///
/// CALL THIS EVERY SINGLE TIME YOU USE SOMETHING FROM THIS LIBRARY!!!!!!
/// You will leak memory otherwise.
///
/// The .NET Pointer to free
[UnmanagedCallersOnly(EntryPoint = "xdg_free")]
public static void Free(IntPtr p)
=> Marshal.FreeCoTaskMem(p);
internal static IntPtr StringToPtr(string? str)
=> Marshal.StringToCoTaskMemUTF8(str);
}
#endif