cBench_s_SFD_process.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:23.0
disk size 516 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 office_ghostscript/src/sfilter1.c 

int nondet();

//Complexity: O(n)
void s_SFD_process(int p, int rlimit, int match) {
	while (p < rlimit) {
		++p;
		if (nondet()) {
			++match;
			if (nondet()) {
				match = 0;
			}
			continue;
		}
		/* No match here, back up to find the longest one. */
		/* This may be quadratic in string_size, but */
		/* we don't expect this to be a real problem. */
		if (match > 0) {
			while (match > 0) {
				match--;
				if ( nondet() )
					break;
			}
			p--;
		}
	}
}

popout

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

actions get anonymous link download benchmark