In API definition, XXX_NULL is not alias for XXX_INVALID. When user passes 
XXX_NULL, it tells that application did not pass a handle. If user passes 
XXX_INVALID, it’s an error (e.g. another ODP call returned XXX_INVALID before 
this one, and user tries to pass that INVALID forward).

Current linux-generic odp_pool_create() implementation uses SHM_NULL and 
SHM_INVALID as synonyms, but that’s not robust and actually against API 
definition, since SHM_INVALID should cause an error.

-Petri


From: lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Bill Fischofer
Sent: Thursday, January 29, 2015 11:14 PM
To: Ola Liljedahl
Cc: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] Handling xxx_INVALID handles

Given that pool creation/deletion is a relatively involved procedure and not 
expected to be called frequently, it makes sense to include full parameter 
validation as part of the operation.  The same should be true for other APIs 
with similar expected call frequencies.

We do allow explicit INVALID input parameters, however for semantic reasons 
they sometimes have aliases.  For example, odp_pool_create() can take 
ODP_SHM_NULL as input to specify that the caller is not supplying a shm handle. 
 However this is just an alias for ODP_SHM_INVALID since that is the 
distinguished "not a handle" value for that data type.

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to