Paste: sample primitive

Author: j
Mode: c++
Date: Tue, 1 Nov 2011 23:42:29
Plain Text |
		for (; from_iter != samples.end(); ++from_iter, ++to_i)
		{
			data_root<array> sample(allot_array(6, false_object),this);

			set_array_nth(sample.untagged(),0,tag_fixnum(from_iter->counts.sample_count));
			set_array_nth(sample.untagged(),1,tag_fixnum(from_iter->counts.gc_sample_count));
			set_array_nth(sample.untagged(),2,tag_fixnum(from_iter->counts.foreign_sample_count));
			set_array_nth(sample.untagged(),3,tag_fixnum(from_iter->counts.foreign_thread_sample_count));

			cell ctx = allot_alien((void*)from_iter->ctx);
			set_array_nth(sample.untagged(),4,ctx);

			cell callstack_size = from_iter->callstack_end - from_iter->callstack_begin;
			data_root<array> callstack(allot_array(callstack_size,false_object),this);

			std::vector<code_block*>::const_iterator
				callstacks_begin = sample_callstacks.begin(),
				c_from_iter = callstacks_begin + from_iter->callstack_begin,
				c_from_iter_end = callstacks_begin + from_iter->callstack_end;
			cell c_to_i = 0;

			for (; c_from_iter != c_from_iter_end; ++c_from_iter, ++c_to_i)
				set_array_nth(callstack.untagged(),c_to_i,(*c_from_iter)->owner);

			set_array_nth(sample.untagged(),5,callstack.value());

			set_array_nth(samples_array.untagged(),to_i,sample.value());
		}

New Annotation

Summary:
Author:
Mode:
Body: