Closed
Description
E.g.:
const DMA_BUFFER_SIZE: usize = 8 * 1024 * 1024;
struct DmaRecorder {
active: bool,
buffer: [u8; DMA_BUFFER_SIZE],
data_len: usize
}
static mut DMA_RECORDER: DmaRecorder = DmaRecorder {
active: false,
buffer: [0; DMA_BUFFER_SIZE],
data_len: 0
};
$ size -Ax libt.rlib
t.0.o (ex libt.rlib):
section size addr
.text 0x0 0x0
.text._ZN4drop17h735fab7fd9067161E 0x6 0x0
.data._ZN1t12DMA_RECORDER17h7409bdfe01c28df8E 0x800010 0x0
.note.GNU-stack 0x0 0x0
.eh_frame 0x30 0x0
Total 0x800046
(and this results in a 8MB file, etc).
Note that this works:
const DMA_BUFFER_SIZE: usize = 8 * 1024 * 1024;
struct DmaRecorder {
buffer: [u8; DMA_BUFFER_SIZE],
data_len: usize
}
static mut DMA_RECORDER: DmaRecorder = DmaRecorder {
buffer: [0; DMA_BUFFER_SIZE],
data_len: 0
};