vm: add some allocates memory comments.

master
John Benediktsson 2020-08-14 10:27:54 -07:00
parent f21deee3df
commit e1085ffef4
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,7 @@ void profiling_sample::clear_counts() volatile {
atomic::fence(); atomic::fence();
} }
// Allocates memory (sample_callstacks2->add) // Allocates memory
void factor_vm::record_sample(bool prolog_p) { void factor_vm::record_sample(bool prolog_p) {
profiling_sample result = current_sample.record_counts(); profiling_sample result = current_sample.record_counts();
if (result.empty()) { if (result.empty()) {
@ -92,6 +92,7 @@ void factor_vm::record_sample(bool prolog_p) {
samples.push_back(result); samples.push_back(result);
} }
// Allocates memory
void factor_vm::set_sampling_profiler(fixnum rate) { void factor_vm::set_sampling_profiler(fixnum rate) {
bool running_p = atomic::load(&sampling_profiler_p); bool running_p = atomic::load(&sampling_profiler_p);
if (rate > 0 && !running_p) if (rate > 0 && !running_p)
@ -100,6 +101,7 @@ void factor_vm::set_sampling_profiler(fixnum rate) {
end_sampling_profiler(); end_sampling_profiler();
} }
// Allocates memory
void factor_vm::start_sampling_profiler(fixnum rate) { void factor_vm::start_sampling_profiler(fixnum rate) {
special_objects[OBJ_SAMPLE_CALLSTACKS] = tag<array>(allot_growarr()); special_objects[OBJ_SAMPLE_CALLSTACKS] = tag<array>(allot_growarr());
samples_per_second = rate; samples_per_second = rate;
@ -118,6 +120,7 @@ void factor_vm::end_sampling_profiler() {
record_sample(false); record_sample(false);
} }
// Allocates memory
void factor_vm::primitive_sampling_profiler() { void factor_vm::primitive_sampling_profiler() {
set_sampling_profiler(to_fixnum(ctx->pop())); set_sampling_profiler(to_fixnum(ctx->pop()));
} }