Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/signal_buffer_leak.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <stdlib.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in #2567, I am a little confused: so you are proposing creating a new directory examples/? Will these be used in automated tests? What is the bigger picture here: could you file a feature issue in the tracker and describe the goal and link this PR to that new issue?

#include <stdio.h>

#define SIGNAL_SIZE 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain in comments why this is called "signal": is this related to UNIX signals, or not?


int main() {
printf("Running signal_buffer_leak...\n");
float *signal = (float *)malloc(SIGNAL_SIZE * sizeof(float));

for (int i = 0; i < SIGNAL_SIZE; i++)
signal[i] = i * 0.01f;

printf("Signal processed.\n");

return 0;
}
Loading