antirez / antirez/dump1090

dump1090.c line 298. Can we save memory of magnitude by 2?

Open
#71 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

Hi,

In dump1090.c line 298:
"
(Modes.magnitude = malloc(Modes.data_len*2)) == NULL) {
"
Why there is "times 2"? Two bytes (I&Q) in Modes.data generates one item in magnitude, and one magnitude item (uint16_t) cost two bytes. So I think magnitude needs exactly the same memory size as data.

Or do I miss sth?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.