Add comment about the evmc_release_result_fn() param

Explains why the evmc_release_result_fn() param is passed by pointer and that it cannot be NULL. It also improves the wording in other parts.

Co-authored-by: Paweł Bylica <chfast@gmail.com>
This commit is contained in:
Alex Beregszaszi 2018-08-27 22:00:08 +01:00 committed by Paweł Bylica
parent 3076fc8429
commit 04081f8631
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF

View File

@ -298,12 +298,18 @@ struct evmc_result;
/**
* Releases resources assigned to an execution result.
*
* This function releases memory (and other resources, if any) assigned to the
* specified execution result making the result object invalid.
* This function releases memory (and other resources, if any) assigned to the
* specified execution result making the result object invalid.
*
* @param result The execution result which resource are to be released. The
* result itself it not modified by this function, but becomes
* invalid and user should discard it as well.
* @param result The execution result which resources are to be released. The
* result itself it not modified by this function, but becomes
* invalid and user MUST discard it as well.
* This MUST NOT be NULL.
*
* @note
* The result is passed by pointer to avoid (shallow) copy of the ::evmc_result
* struct. Think of this as the best possible C language approximation to
* passing objects by reference.
*/
typedef void (*evmc_release_result_fn)(const struct evmc_result* result);