Changeset a9c298 in git for kernel/mod2.h
- Timestamp:
- Nov 20, 2013, 4:54:25 PM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 0de0509972719531e2a4b51ec9fd0e44a66fd2fd
- Parents:
- e4014563a82388c4b39dfa37db24cbe159b24a35
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-20 16:54:25+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-20 16:54:42+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/mod2.h
re40145 ra9c298 66 66 /* procedures to compute groebner bases with the f5 implementation */ 67 67 /* still testing */ 68 #undef HAVE_F5 68 #undef HAVE_F5 69 69 70 70 /* procedures to compute groebner bases with the f5c implementation */ … … 186 186 ... 187 187 188 makes sure that all poly operations in your file are done with 188 makes sure that all poly operations in your file are done with 189 189 PDEBUG == 2 190 190 To break after an error occured, set a debugger breakpoint on 191 dErrorBreak. 191 dErrorBreak. 192 192 */ 193 193 #ifndef PDEBUG … … 223 223 1 : addresses are only marked as free and not really freed. 224 224 225 OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis 225 OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis 226 226 (as can OM_NDEBUG), e.g.: 227 227 #define OM_CHECK 3 … … 230 230 #include "mod2.h" 231 231 #include <omalloc/omalloc.h> 232 ensures that all memory allocs/free in this file are done with 233 OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed 232 ensures that all memory allocs/free in this file are done with 233 OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed 234 234 in this file are only marked as free and never really freed. 235 236 To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set 237 om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and 238 om_Opts.Keep to the number of addresses which are kept before they are 235 236 To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set 237 om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and 238 om_Opts.Keep to the number of addresses which are kept before they are 239 239 actually freed. E.g.: 240 240 int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep; … … 243 243 om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep; 244 244 ensures that all calls omDebug routines occuring during the computation of 245 ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and 245 ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and 246 246 calls to omFree only mark addresses as free and not really free them. 247 247 248 Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies 249 how many addresses are kept before they are actually freed, independently 248 Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies 249 how many addresses are kept before they are actually freed, independently 250 250 of the value of OM_KEEP. 251 251 … … 260 260 Under dynamic scope, do (e.g., from within the debugger): 261 261 om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX; 262 + to find out where "memory corruption" occured, increase value of 263 OM_CHECK - the higher this value is, the more consistency checks are 264 done (However a value > 3 checks the entire memory each time an omalloc 262 + to find out where "memory corruption" occured, increase value of 263 OM_CHECK - the higher this value is, the more consistency checks are 264 done (However a value > 3 checks the entire memory each time an omalloc 265 265 routine is used!) 266 266 267 267 Some more tips on the usage of omalloc: 268 + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines 268 + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines 269 269 assume that sizes are > 0 and pointers are != NULL 270 270 + omalloc*, omrealloc*, omfree* omcheck*, omdebug* omtest* routines allow 271 271 NULL pointers and sizes == 0 272 + You can safely use any free/realloc routine in combination with any alloc 272 + You can safely use any free/realloc routine in combination with any alloc 273 273 routine (including the debug versions): E.g., an address allocated with 274 omAllocBin can be freed with omfree, or an adress allocated with 274 omAllocBin can be freed with omfree, or an adress allocated with 275 275 om(Debug)Alloc can be freed with omfree, or omFree, or omFreeSize, etc. 276 However, keep in mind that the efficiency decreases from 276 However, keep in mind that the efficiency decreases from 277 277 Bin over Size to General routines (i.e., omFreeBin is more efficient than 278 278 omFreeSize which is more efficient than omFree, likewise with the alloc 279 279 routines). 280 280 + if OM_CHECK is undefined or 0, then all omCheck routines do nothing 281 + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is 282 defined, then the "real" alloc/realloc/free macros are used, and all 281 + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is 282 defined, then the "real" alloc/realloc/free macros are used, and all 283 283 omTest, omDebug and omCheck routines are undefined 284 + to break after an omError occured within a debugger, 284 + to break after an omError occured within a debugger, 285 285 set a breakpoint on dErrorBreak 286 + to do checks from within the debugger, or to do checks with explicit 286 + to do checks from within the debugger, or to do checks with explicit 287 287 check level, use omTest routines. 288 288 */ … … 296 296 #define OM_CHECK 1 297 297 #endif 298 /* Do actually free memory: 299 (be careful: if this is set, memory is never really freed, 298 /* Do actually free memory: 299 (be careful: if this is set, memory is never really freed, 300 300 but only marked as free) */ 301 301 #ifndef OM_KEEP 302 302 #define OM_KEEP 0 303 303 #endif 304 /* but only after you have freed 1000 more addresses 304 /* but only after you have freed 1000 more addresses 305 305 (this is actually independent of the value of OM_KEEP and used 306 306 to initialize om_Opts.Keep) */ … … 312 312 313 313 314 /* undef KDEBUG for check of data during std computations 314 /* undef KDEBUG for check of data during std computations 315 315 * 316 316 * define KDEBUG to 317 317 * 0 for basic tests 318 * 1 for tests in kSpoly 319 * NOTE: You can locally enable tests in kspoly by setting the 318 * 1 for tests in kSpoly 319 * NOTE: You can locally enable tests in kspoly by setting the 320 320 * define at the beginning of kspoly.cc 321 321 */ … … 433 433 #ifdef HAVE_ASSUME 434 434 #ifndef RDEBUG 435 #define RDEBUG 435 #define RDEBUG 436 436 #endif 437 437 #endif
Note: See TracChangeset
for help on using the changeset viewer.