As discussed before, I think this function can crash on bad handles as any 
other buffer API call. So, let's leave out this patch.

More documentation on "sanity" checking can be added with another patch.

-Petri

> -----Original Message-----
> From: [email protected] [mailto:lng-odp-
> [email protected]] On Behalf Of ext Ola Liljedahl
> Sent: Wednesday, February 04, 2015 11:07 PM
> To: [email protected]
> Subject: [lng-odp] [PATCHv6 3/9] api: odp_buffer.h: undefined behavior
> description
> 
> Signed-off-by: Ola Liljedahl <[email protected]>
> ---
> (This document/code contribution attached is provided under the terms of
> agreement LES-LTM-21309)
> 
>  include/odp/api/buffer.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h
> index 09bddf2..e0e25b0 100644
> --- a/include/odp/api/buffer.h
> +++ b/include/odp/api/buffer.h
> @@ -88,7 +88,9 @@ uint32_t odp_buffer_size(odp_buffer_t buf);
>  /**
>   * Tests if buffer is valid
>   *
> - * @param buf      Buffer handle
> + * @param buf      Buffer handle (possibly invalid)
> + * @note This is the only buffer API function which accepts invalid
> buffer
> + * handles (any bit value) without causing undefined behavior.
>   *
>   * @retval 1 Buffer handle represents a valid buffer.
>   * @retval 0 Buffer handle does not represent a valid buffer.
> --
> 1.9.1
> 
> 
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to