updated benchfn.h code comments

This commit is contained in:
Yann Collet
2019-01-25 12:18:33 -08:00
parent 2888c62e85
commit 6b2f26791e
+9 -8
View File
@@ -58,11 +58,12 @@ typedef size_t (*BMK_initFn_t)(void* initPayload);
typedef unsigned (*BMK_errorFn_t)(size_t); typedef unsigned (*BMK_errorFn_t)(size_t);
/* BMK_benchFunction() parameters are provided through following structure. /* BMK_benchFunction() parameters are provided via the following structure.
* This is preferable for readability, * A structure is preferable for readability,
* as the number of parameters required is pretty large. * as the number of parameters required is fairly large.
* No initializer is provided, because it doesn't make sense to provide some "default" : * No initializer is provided, because it doesn't make sense to provide some "default" :
* all parameters should be specified by the caller */ * all parameters must be specified by the caller.
* optional parameters are labelled explicitly, and accept value NULL when not used */
typedef struct { typedef struct {
BMK_benchFn_t benchFn; /* the function to benchmark, over the set of blocks */ BMK_benchFn_t benchFn; /* the function to benchmark, over the set of blocks */
void* benchPayload; /* pass custom parameters to benchFn : void* benchPayload; /* pass custom parameters to benchFn :
@@ -77,10 +78,10 @@ typedef struct {
size_t blockCount; /* number of blocks to operate benchFn on. size_t blockCount; /* number of blocks to operate benchFn on.
* It's also the size of all array parameters : * It's also the size of all array parameters :
* srcBuffers, srcSizes, dstBuffers, dstCapacities, blockResults */ * srcBuffers, srcSizes, dstBuffers, dstCapacities, blockResults */
const void *const * srcBuffers; /* array of buffers to be operated on by benchFn */ const void *const * srcBuffers; /* read-only array of buffers to be operated on by benchFn */
const size_t* srcSizes; /* array of the sizes of srcBuffers buffers */ const size_t* srcSizes; /* read-only array containing sizes of srcBuffers */
void *const * dstBuffers;/* array of buffers to be written into by benchFn */ void *const * dstBuffers; /* array of buffers to be written into by benchFn. This array is not optional, it must be provided even if unused by benchfn. */
const size_t* dstCapacities; /* array of the capacities of dstBuffers buffers */ const size_t* dstCapacities; /* read-only array containing capacities of dstBuffers. This array must be present. */
size_t* blockResults; /* Optional: store the return value of benchFn for each block. Use NULL if this result is not requested. */ size_t* blockResults; /* Optional: store the return value of benchFn for each block. Use NULL if this result is not requested. */
} BMK_benchParams_t; } BMK_benchParams_t;