Пример #1
0
static int free_all_sample_buffers(void)
{
	int cpu;

	for_each_possible_cpu(cpu)
	{
		free_sample_buffer(cpu);
	}

	return 0;
}
size_t init_sample_buffer(struct sample *s, const size_t count)
{
        if (s->channel_samples)
                free_sample_buffer(s);

        const size_t size = sizeof(ChannelSample[count]);
        s->channel_samples = (ChannelSample *) portMalloc(size);

        if (NULL == s->channel_samples)
                return 0;

        s->ticks = 0;
        s->channel_count = count;
        init_channel_sample_buffer(getWorkingLoggerConfig(), s);

        return size;
}