Skip to content

Commit

Permalink
Add random code to environment.c which will affect code size
Browse files Browse the repository at this point in the history
  • Loading branch information
magnmaeh committed Oct 13, 2024
1 parent a82dbda commit e348e73
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,35 @@
#include "reactor-uc/scheduler.h"
#include <assert.h>

static struct UsingSomeData {
uint8_t array[100];
Environment env;
} data[3];

void Environment_assemble(Environment *self) { validaten(self->main->calculate_levels(self->main)); }

void Environment_start(Environment *self) { self->scheduler.run(&self->scheduler); }

void not_useful_function(const char *msg) {
static bool bools[19];
for (uint32_t i = 0; i < sizeof(bools); i++) {
if (bools[i] == true) {
puts(msg);
bools[i] = false;
} else {
bools[i] = true;
data[0] = (struct UsingSomeData) {
.array = { 0 }
};
}
}
}

lf_ret_t Environment_wait_until(Environment *self, instant_t wakeup_time) {
if (wakeup_time < self->get_physical_time(self)) {
return LF_OK;
}

not_useful_function("Testing");
if (self->has_async_events) {
return self->platform->wait_until_interruptable(self->platform, wakeup_time);
} else {
Expand Down Expand Up @@ -50,6 +70,8 @@ void Environment_ctor(Environment *self, Reactor *main) {
self->get_physical_time = Environment_get_physical_time;
self->get_elapsed_physical_time = Environment_get_elapsed_physical_time;

not_useful_function("Hello");

self->keep_alive = false;
self->has_async_events = false;
self->startup = NULL;
Expand Down

0 comments on commit e348e73

Please sign in to comment.