We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c307006 commit 3c92b07Copy full SHA for 3c92b07
LLama/Native/MtmdContextParams.cs
@@ -138,7 +138,16 @@ private PinnedUtf8String(string value)
138
139
public static PinnedUtf8String? Create(string? value) => value is null ? null : new PinnedUtf8String(value);
140
141
- public IntPtr Pointer => _buffer is null ? IntPtr.Zero : _handle.AddrOfPinnedObject();
+ public IntPtr Pointer
142
+ {
143
+ get
144
145
+ if (_buffer is null || !_handle.IsAllocated)
146
+ return IntPtr.Zero;
147
+
148
+ return _handle.AddrOfPinnedObject();
149
+ }
150
151
152
public void Dispose()
153
{
0 commit comments