79245768

Date: 2024-12-02 22:29:36
Score: 1
Natty:
Report link

I'm not seeing the point in the need to use DllImport and C? If you're using C# you could just use these functions in C#.

using System.Runtime.InteropServices;
static IntPtr AllocateMem() => Marshal.AllocHGlobal(4096);
static void FreeMem(IntPtr mem) => Marshal.FreeHGlobal(mem);

This would help prevent the need for extra dependencies while providing better optimazation and memory management.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Charles Henington