1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 // AdvApp2Var_SysBase.hxx
15 #ifndef AdvApp2Var_SysBase_HeaderFile
16 #define AdvApp2Var_SysBase_HeaderFile
18 #include <Standard_Macro.hxx>
19 #include <AdvApp2Var_Data_f2c.hxx>
26 class AdvApp2Var_SysBase {
28 Standard_EXPORT AdvApp2Var_SysBase();
29 Standard_EXPORT ~AdvApp2Var_SysBase();
32 Standard_EXPORT int mainial_();
34 Standard_EXPORT static int macinit_(int *,
37 Standard_EXPORT int mcrdelt_(integer *iunit,
43 Standard_EXPORT static int mcrfill_(integer *size,
47 Standard_EXPORT int mcrrqst_(integer *iunit,
52 Standard_EXPORT static integer mnfndeb_();
54 Standard_EXPORT static int do__fio();
55 Standard_EXPORT static int do__lio ();
56 Standard_EXPORT int macrai4_(integer *nbelem,
61 Standard_EXPORT int macrar8_(integer *nbelem,
66 Standard_EXPORT int macrdi4_(integer *nbelem,
72 Standard_EXPORT int macrdr8_(integer *nbelem,
77 Standard_EXPORT static int maermsg_(const char *cnompg,
80 Standard_EXPORT static int maitbr8_(integer *itaill,
83 Standard_EXPORT static int maovsr8_(integer *ivalcs);
84 Standard_EXPORT static int mgenmsg_(const char *nomprg,
87 Standard_EXPORT static int mgsomsg_(const char *nomprg,
89 Standard_EXPORT static void miraz_(integer *taille,
91 Standard_EXPORT static int msifill_(integer *nbintg,
94 Standard_EXPORT static int msrfill_(integer *nbreel,
97 Standard_EXPORT static int mswrdbg_(const char *ctexte,
99 Standard_EXPORT static void mvriraz_(integer *taille,
104 int mcrlist_(integer *ier) const;
106 /* Maximum number of allowed allocation requests.
107 Currently the maximum known number of requests is 7 - see
108 AdvApp2Var_MathBase::mmresol_(). So the current value is a safe margin and
109 a reasonable balance to not provoke stack overflow (especially in
110 multi-threaded execution). Previous number of 1000 was excessive but
111 tolerable when used for static memory.
113 static const int MAX_ALLOC_NB = 32;
116 static_allocation = 0, /* indicates static allocation, currently not used */
117 heap_allocation = 1 /* indicates heap allocation */
120 /* Describes an individual memory allocation request.
121 See format description in the AdvApp2Var_SysBase.cxx.
122 The field order is preserved and the sizes are chosen to minimize
123 memory footprint. Fields containing address have the intptr_t type
124 for easier arithmetic and to avoid casts in the source code.
126 No initialization constructor should be provided to avoid wasting
127 time when allocating a field mcrgene_.
131 unsigned char unit; //unit of allocation: 1, 2, 4 or 8
135 unsigned char alloctype; // static_allocation or heap_allocation
138 integer userzone; //not used
145 mitem icore[MAX_ALLOC_NB];
150 /* Contains statistics on allocation requests.
151 Index 0 corresponds to static_allocation, 1 - to heap allocation.
152 nrqst - number of allocation requests;
153 ndelt - number of deallocation requests;
154 nbyte - current number of allocated bytes;
155 mbyte - maximum number of ever allocated bytes.
158 integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];