Comments (1)
So we have:
#[derive(Copy, Clone, Debug, Default)]
#[repr(C)]
pub struct Bs<'a> {
pub buf: &'a [u8],
pub pos: i32,
pub limit: i32,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct Mp3DecScratch<'a> {
pub bs: Bs<'a>,
pub maindata: [u8; 2815],
pub gr_info: [L3GrInfo; 4],
pub grbuf: [[f32; 576]; 2],
pub scf: [f32; 40],
pub syn: [[f32; 64]; 33],
pub ist_pos: [[u8; 39]; 2],
}
And per the report, the slice in the Bs
is initialized to point to maindata
, which results in a self-borrowing struct, which is verboten.
I can think of a few potential solutions. For one, maindata
is not actually used in very many places; perhaps we could just stuff it into the Bs
struct and have an index instead of a slice.
It also looks like Bs
is used almost exclusively to pass to get_bits()
, there are very few places where buf
is accessed directly outside that. So rearranging things might not be such a global change after all.
We're not gonna bother with nightly; I'd use heap allocation first.
from rinimp3.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rinimp3.