public static IntPtr CreateMarker(string name, ushort categoryId, MarkerFlags flags, int metadataCount) { #if ENABLE_PROFILER int textBytes = UTF8.GetByteCount(name); unsafe { byte *bytes = stackalloc byte[textBytes]; fixed(char *t = name) { UTF8.GetBytes(t, name.Length, bytes, textBytes); } return((IntPtr)Development.Profiling.Profiler.MarkerGetOrCreate(categoryId, bytes, textBytes, (ushort)(flags | MarkerFlags.Script))); } #else return(IntPtr.Zero); #endif }
static extern IntPtr Internal_Create(string name, MarkerFlags flags);
public static extern unsafe void *CreateCounterValue(out IntPtr counterPtr, string name, ushort categoryId, MarkerFlags flags, byte dataType, byte dataUnit, int dataSize, ProfilerCounterOptions counterOptions);
public static extern IntPtr CreateMarker(string name, ushort categoryId, MarkerFlags flags, int metadataCount);
private unsafe static extern void *CreateCounterValue_Unsafe(out IntPtr counterPtr, char *name, int nameLen, ushort categoryId, MarkerFlags flags, byte dataType, byte dataUnit, int dataSize, ProfilerCounterOptions counterOptions);
public unsafe static void *CreateCounterValue(out IntPtr counterPtr, char *name, int nameLen, ushort categoryId, MarkerFlags flags, byte dataType, byte dataUnit, int dataSize, ProfilerCounterOptions counterOptions) { return(ProfilerUnsafeUtility.CreateCounterValue_Unsafe(out counterPtr, name, nameLen, categoryId, flags, dataType, dataUnit, dataSize, counterOptions)); }
private unsafe static extern IntPtr CreateMarker_Unsafe(char *name, int nameLen, ushort categoryId, MarkerFlags flags, int metadataCount);
public unsafe static IntPtr CreateMarker(char *name, int nameLen, ushort categoryId, MarkerFlags flags, int metadataCount) { return(ProfilerUnsafeUtility.CreateMarker_Unsafe(name, nameLen, categoryId, flags, metadataCount)); }
internal unsafe static extern IntPtr CreateMarker__Unmanaged(byte *name, int nameLen, ushort categoryId, MarkerFlags flags, int metadataCount);
public unsafe ProfilerMarker(ProfilerCategory category, char *name, int nameLen, MarkerFlags flags) { m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, nameLen, category, flags, 0); }
public ProfilerMarker(ProfilerCategory category, string name, MarkerFlags flags) { m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, category, flags, 0); }
internal static extern unsafe void *CreateCounterValue__Unmanaged(out IntPtr counterPtr, byte *name, int nameLen, ushort categoryId, MarkerFlags flags, byte dataType, byte dataUnit, int dataSize, ProfilerCounterOptions counterOptions);
public static unsafe IntPtr CreateMarker(char *name, int nameLen, ushort categoryId, MarkerFlags flags, int metadataCount) { return(CreateMarker_Unsafe(name, nameLen, categoryId, flags, metadataCount)); }