File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,13 @@ class ps_ptr {
6666 void alloc () {
6767 alloc (sizeof (T));
6868 }
69+ // —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
70+ // 📌📌📌 A L L O C _ A R R A Y 📌📌📌
71+
72+ void alloc_array (std::size_t count, const char * name = nullptr ) {
73+ alloc (sizeof (T) * count, name);
74+ clear ();
75+ }
6976// —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
7077 // 📌📌📌 R E A L L O C 📌📌📌
7178
Original file line number Diff line number Diff line change @@ -1784,10 +1784,10 @@ int32_t mapping_inverse(vorbis_info_mapping_t *info) {
17841784 int32_t i, j;
17851785 int32_t n = s_blocksizes[s_dsp_state->W ];
17861786
1787- ps_ptr<int32_t *> pcmbundle; pcmbundle.alloc ( sizeof ( int32_t *) * s_vorbisChannels); pcmbundle.clear ();
1787+ ps_ptr<int32_t *> pcmbundle; pcmbundle.alloc_array ( s_vorbisChannels); pcmbundle.clear ();
17881788 ps_ptr<int32_t > zerobundle; zerobundle.alloc (sizeof (int32_t ) * s_vorbisChannels);
17891789 ps_ptr<int32_t > nonzero; nonzero.alloc (sizeof (int32_t ) * s_vorbisChannels);
1790- ps_ptr<int32_t *> floormemo; floormemo.alloc ( sizeof ( int32_t *) * s_vorbisChannels); floormemo. clear ( );
1790+ ps_ptr<int32_t *> floormemo; floormemo.alloc_array ( s_vorbisChannels);
17911791
17921792 /* recover the spectral envelope; store it in the PCM vector for now */
17931793 for (i = 0 ; i < s_vorbisChannels; i++) {
You can’t perform that action at this time.
0 commit comments