Skip to content

Commit

Permalink
docs: clear up memory ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmd-azeez committed Sep 26, 2024
1 parent c0bee5c commit 572dbaf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Extism.Pdk/Interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ public static void Log(LogLevel level, string message)
}

/// <summary>
/// Log a message with the specified log level to the host.
/// Read a var that's persisted by the host. See <see cref="SetVar(string, MemoryBlock)"/>
/// </summary>
/// <param name="key">The log level for the message.</param>
/// <param name="block">The log message as a string.</param>
/// <returns></returns>
/// <param name="key">The variable name.</param>
/// <param name="block">The value of the variable. The plugin should take ownership of the block and free it after reading the data.</param>
/// <returns>true if the variable is found, false otherwise.</returns>
public static bool TryGetVar(string key, out MemoryBlock block)
{
var keyBlock = Allocate(key);
Expand Down Expand Up @@ -303,7 +303,7 @@ public static void RemoveVar(string key)
/// Send an HTTP request synchronously and get the response from the host.
/// </summary>
/// <param name="request">The HTTP request to send.</param>
/// <returns>The HTTP response received from the host.</returns>
/// <returns>The HTTP response received from the host. The plugin takes ownership of the memory block and is expected to free it.</returns>
public static HttpResponse SendRequest(HttpRequest request)
{
using var stream = new MemoryStream();
Expand Down

0 comments on commit 572dbaf

Please sign in to comment.