cBench_send_tree.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:23.0
disk size 483 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
//taken from cBench security_pgp_d/src/ztrees.c	send_tree

int random();

//Complexity: O(n)
void send_tree(int max_code, int max_count, int min_count)
{
    int n;
    int count = 0;
    for (n = 0; n <= max_code; n++) {
	if (++count < max_count && random()) {
	    //continue;
	} else {
	  if (count < min_count) {
	    do {
	    } while (--count > 0); //original code: --count != 0
	  } else if (random()) {
	    if (random()) {
		count--;
	    };
	  }
	  count = 0;
    }
  }
}

popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark