26template<
class PROGRAM_CLASS>
class MetafontMemoryHandlerImpl :
27 public TeXMFMemoryHandlerImpl<PROGRAM_CLASS>
32 MetafontMemoryHandlerImpl(PROGRAM_CLASS& program,
TeXMFApp& texmfapp) :
33 TeXMFMemoryHandlerImpl<PROGRAM_CLASS>(program, texmfapp)
37 void Allocate(
const std::unordered_map<std::string, int>& userParams)
override
39 TeXMFMemoryHandlerImpl<PROGRAM_CLASS>::Allocate(userParams);
41 this->program.bistacksize = this->GetCheckedParameter(
"bistack_size", this->program.infbistacksize, this->program.supbistacksize, userParams, mfapp::mfapp::bistack_size());
42 this->program.ligtablesize = this->GetCheckedParameter(
"lig_table_size", this->program.infligtablesize, this->program.supligtablesize, userParams, mfapp::mfapp::lig_table_size());
43 this->program.pathsize = this->GetCheckedParameter(
"path_size", this->program.infpathsize, this->program.suppathsize, userParams, mfapp::mfapp::path_size());
45 this->AllocateArray(
"bisectstack", this->program.bisectstack, this->program.bistacksize);
46 this->AllocateArray(
"delta", this->program.delta, this->program.pathsize);
47 this->AllocateArray(
"deltax", this->program.deltax, this->program.pathsize);
48 this->AllocateArray(
"deltay", this->program.deltay, this->program.pathsize);
49 this->AllocateArray(
"ligkern", this->program.ligkern, this->program.ligtablesize);
50 this->AllocateArray(
"psi", this->program.psi, this->program.pathsize);
51 this->AllocateArray(
"strref", this->program.strref, this->program.maxstrings);
52 this->AllocateArray(
"theta", this->program.theta, this->program.pathsize);
53 this->AllocateArray(
"uu", this->program.uu, this->program.pathsize);
54 this->AllocateArray(
"vv", this->program.vv, this->program.pathsize);
55 this->AllocateArray(
"ww", this->program.ww, this->program.pathsize);
58 this->AllocateArray(
"free", this->program.c4p_free, this->program.memmax);
59 this->AllocateArray(
"wasfree", this->program.wasfree, this->program.memmax);
65 TeXMFMemoryHandlerImpl<PROGRAM_CLASS>::Free();
66 this->FreeArray(
"bisectstack", this->program.bisectstack);
67 this->FreeArray(
"delta", this->program.delta);
68 this->FreeArray(
"deltax", this->program.deltax);
69 this->FreeArray(
"deltay", this->program.deltay);
70 this->FreeArray(
"ligkern", this->program.ligkern);
71 this->FreeArray(
"psi", this->program.psi);
72 this->FreeArray(
"strref", this->program.strref);
73 this->FreeArray(
"theta", this->program.theta);
74 this->FreeArray(
"uu", this->program.uu);
75 this->FreeArray(
"vv", this->program.vv);
76 this->FreeArray(
"ww", this->program.ww);
78 this->FreeArray(
"c4p_free", this->program.c4p_free);
79 this->FreeArray(
"wasfree", this->program.wasfree);
85 TeXMFMemoryHandlerImpl<PROGRAM_CLASS>::Check();
86 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.bisectstack);
87 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.delta);
88 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.deltax);
89 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.deltay);
90 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.ligkern);
91 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.psi);
92 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.strref);
93 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.theta);
94 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.uu);
95 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.vv);
96 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.ww);
98 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.c4p_free);
99 MIKTEX_ASSERT_VALID_HEAP_POINTER_OR_NIL(this->program.wasfree);