diff --git a/src/textord/gap_map.cpp b/src/textord/gap_map.cpp index c4ba63d09..719a6118a 100644 --- a/src/textord/gap_map.cpp +++ b/src/textord/gap_map.cpp @@ -7,8 +7,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "statistc.h" -#include "gap_map.h" + +#include "statistc.h" +#include "gap_map.h" #define EXTERN EXTERN BOOL_VAR (gapmap_debug, FALSE, "Say which blocks have tables"); @@ -79,7 +80,7 @@ GAPMAP::GAPMAP( //Constructor } bucket_size = (int16_t) floor (xht_stats.median () + 0.5) / 2; map_max = (max_right - min_left) / bucket_size; - map = (int16_t *) alloc_mem ((map_max + 1) * sizeof (int16_t)); + map = new int16_t[map_max + 1]; for (i = 0; i <= map_max; i++) map[i] = 0; diff --git a/src/textord/gap_map.h b/src/textord/gap_map.h index 3582cdd57..cc94690d6 100644 --- a/src/textord/gap_map.h +++ b/src/textord/gap_map.h @@ -7,10 +7,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#ifndef GAP_MAP_H -#define GAP_MAP_H -#include "blobbox.h" +#ifndef GAP_MAP_H +#define GAP_MAP_H + +#include "blobbox.h" class GAPMAP { @@ -19,8 +20,7 @@ class GAPMAP TO_BLOCK *block); ~GAPMAP () { //destructor - if (map != nullptr) - free_mem(map); + delete[] map; } bool table_gap( //Is gap a table? @@ -45,4 +45,5 @@ extern BOOL_VAR_H (gapmap_use_ends, FALSE, extern BOOL_VAR_H (gapmap_no_isolated_quanta, FALSE, "Ensure gaps not less than 2quanta wide"); extern double_VAR_H (gapmap_big_gaps, 1.75, "xht multiplier"); + #endif