All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Detailed Descriptionmemory allocation routines Definition in file memory.c. #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> #include "blockmemshell/memory.h" Go to the source code of this file.
Macro Definition Documentation
Definition at line 43 of file memory.c. Referenced by allocChunkElement(), BMSallocBlockMemory_call(), BMSallocChunkMemory_call(), BMSallocClearMemory_call(), BMSallocMemory_call(), BMSclearChunkMemory_call(), BMScreateChunkMemory_call(), BMSdestroyChunkMemory_call(), BMSfreeBlockMemory_call(), BMSfreeChunkMemory_call(), BMSgarbagecollectChunkMemory_call(), createChunk(), destroyChunk(), freeChunk(), freeChunkElement(), garbagecollectChkmem(), linkChunk(), and unlinkChunk().
Definition at line 44 of file memory.c. Referenced by garbagecollectChkmem().
Definition at line 45 of file memory.c. Referenced by BMSallocBlockMemory_call(), BMSallocChunkMemory_call(), BMSallocClearMemory_call(), BMSallocMemory_call(), BMSclearBlockMemory_call(), BMSclearChunkMemory_call(), BMScreateBlockMemory_call(), BMScreateChunkMemory_call(), BMSdestroyBlockMemory_call(), BMSdestroyChunkMemory_call(), BMSfreeBlockMemory_call(), BMSfreeChunkMemory_call(), BMSfreeMemory_call(), BMSreallocMemory_call(), and freeChkmemElement().
Definition at line 46 of file memory.c. Referenced by BMSallocBlockMemory_call(), BMSallocChunkMemory_call(), BMSallocClearMemory_call(), BMSallocMemory_call(), BMSclearBlockMemory_call(), BMSclearChunkMemory_call(), BMScreateBlockMemory_call(), BMScreateChunkMemory_call(), BMSdestroyBlockMemory_call(), BMSdestroyChunkMemory_call(), BMSfreeBlockMemory_call(), BMSfreeChunkMemory_call(), BMSfreeMemory_call(), BMSreallocMemory_call(), and freeChkmemElement().
Definition at line 50 of file memory.c. Referenced by BMScheckEmptyBlockMemory_call(), BMScheckEmptyMemory_call(), BMSdisplayBlockMemory_call(), and BMSdisplayMemory_call().
Definition at line 54 of file memory.c. Referenced by createChunk(), and linkChunk().
Definition at line 55 of file memory.c. Referenced by linkChunk().
Definition at line 58 of file memory.c. Referenced by BMSallocClearMemory_call(), BMSallocMemory_call(), BMSreallocMemory_call(), and createChunk().
Definition at line 59 of file memory.c. Referenced by addBilinMcCormick(), addConcaveEstimatorBivariate(), addConcaveEstimatorMultivariate(), addConflictBinvar(), addIntervalGradientEstimator(), addLinearization(), addLinearizationCuts(), aggregation(), analyzeEnergyRequirement(), applyFixings(), applyVbounds(), BMSreallocBlockMemory_call(), calcPscostQuot(), calcScore(), calcShiftVal(), calculateBounds(), checkArraySizesGLS(), checkArraySizesHeur(), checkCurvature(), checkFactorable(), checkFixedVariables(), checkRedundancySide(), chooseDoubleVar(), collectBinaryCliqueData(), collectBinaryImplicationData(), collectBinaryVars(), collectBranchingCands(), collectDataTTEF(), collectIntVars(), collectMaxactVar(), collectNonBinaryImplicationData(), collectNonBinaryVBoundData(), collectThetaSubtree(), computeCoreWithInterval(), computeFieldWidth(), computeFixingOrder(), computeViolation(), conflictAnalyze(), conflictCreateReconvergenceConss(), conflictInsertConflictset(), conflictMarkBoundCheckPresence(), conflictsetAddBound(), conflictsetAddBounds(), conflictsetCalcInsertDepth(), consCapacityConstraintsFinder(), consCheckRedundancy(), consdataGetActivity(), consdataGetFeasibility(), consdataTightenCoefs(), consdataUpdateLinearActivity(), copyAndSolveComponent(), coretimesUpdateLb(), createChunk(), createCoreProfile(), createCoverCuts(), createCoverCutsTimepoint(), createCoveringProblem(), createDisjuctiveCons(), createNlRow(), createSubproblem(), createSubscip(), cutGenerationHeuristic(), cutpoolDelCut(), detectRedundantConstraints(), determineBound(), dualWeightsTightening(), ensureMemorySize(), evalLhs(), evalMin(), execRelpscost(), exprgraphUpdateVarNodeBounds(), exprUnconvertPolynomial(), findDominancePairs(), fixAndPropagate(), fixDiscreteVars(), fullDualPresolve(), generateCloseCutPoint(), generateConvexConcaveUnderestimator(), generateCut(), generateCutLTIcomputeCoefs(), generateCutSol(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateSparseCut(), generateUnderestimatorParallelYFacets(), getBounddist(), getFlowCover(), getImpliedBounds(), getIterationsLeft(), getZiValue(), GUBsetCalcCliquePartition(), handleCycle(), hashtableResize(), hessLagAddExprtree(), hessLagSparsitySetNzFlagForExprtree(), initSepaData(), insertSortedRootNeighbors(), insertZerolist(), isLbBetter(), isUbBetter(), lpGetResolveItlim(), nlrowRemoveFixedLinearCoefs(), nlrowRemoveFixedQuadVars(), nodeGetUctScore(), nodepairqueueCreate(), normalizeCons(), normalizeCumulativeCondition(), optimize(), paramsetSetSeparatingAggressive(), performFixing(), performStrongbranchWithPropagation(), perturb(), preprocessCliques(), preprocessConstraintPairs(), presolveConsEst(), presolveConsLct(), presolveDual(), presolveFindDuplicates(), presolveTryAddLinearReform(), prettifyConss(), priceAndCutLoop(), primalAddOrigSol(), primalAddSol(), primalSetCutoffbound(), primalSetUpperbound(), propagateBounds(), propagateBoundsBilinearTerm(), propagateBoundsCons(), propagateBoundsGetQuadActivity(), propagateCons(), propagateLbTTEF(), propagateTimetable(), propagateUbTTEF(), proposeBranchingPoint(), proposeFeasibleSolution(), readNonlinearExprs(), registerVariableInfeasibilities(), resolvePropagation(), resolvePropagationCoretimes(), respropCumulativeCondition(), rowAddNorms(), rowCalcIdxsAndVals(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSINITLP(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_EXPREVAL(), SCIP_DECL_EXPRGRAPHVARADDED(), SCIP_DECL_HEUREXEC(), SCIP_DECL_NLPISETINTPAR(), SCIP_DECL_NODESELSELECT(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_PROPRESPROP(), SCIP_DECL_SEPAEXECLP(), SCIPaddToNlpiProblemQuadratic(), SCIPanalyzeDeductionsProbing(), SCIPapplyHeurDualval(), SCIPapplyHeurSubNlp(), SCIPapplyProximity(), SCIPapplyUndercover(), SCIPapplyZeroobj(), SCIPboolarrayExtend(), SCIPboolarraySetVal(), SCIPbranchGetBranchingPoint(), SCIPcalcCliquePartition(), SCIPcalcIntegralScalar(), SCIPcolGetStrongbranch(), SCIPcolGetStrongbranches(), SCIPcolSetStrongbranchData(), SCIPconflictAddRelaxedBound(), SCIPconshdlrPropagate(), SCIPconshdlrSeparateLP(), SCIPevalExprtreeLocalBounds(), SCIPexprgraphGetSeparableTrees(), SCIPgetGap(), SCIPgetTransGap(), SCIPinferVarLbCons(), SCIPinferVarLbProp(), SCIPintarrayExtend(), SCIPintarraySetVal(), SCIPintervalIntersect(), SCIPintervalIsSubsetEQ(), SCIPintervalMin(), SCIPintervalMulInf(), SCIPintervalPowerScalarInverse(), SCIPintervalQuadBivar(), SCIPintervalSolveBivariateQuadExpressionAllScalar(), SCIPintervalUnify(), SCIPlpGetRootObjval(), SCIPlpGetSol(), SCIPlpGetUnboundedSol(), SCIPlpiGetSolverName(), SCIPlpiSetIntpar(), SCIPlpShrinkCols(), SCIPlpShrinkRows(), SCIPlpSolveAndEval(), SCIPnlpiOracleGetJacobianSparsity(), SCIPnlrowCreate(), SCIPnlrowGetNLPFeasibility(), SCIPnlrowGetPseudoFeasibility(), SCIPnlrowGetSolActivity(), SCIPnlrowGetSolFeasibility(), SCIPnodeAddBoundinfer(), SCIPnodeCutoff(), SCIPnodeFocus(), SCIPnodePropagateAgain(), SCIPparamSetReal(), SCIPprimalUpdateObjlimit(), SCIPprimalUpdateObjoffset(), SCIPprobUpdateDualbound(), SCIPptrarrayExtend(), SCIPptrarraySetVal(), SCIPrealarrayExtend(), SCIPrealarraySetVal(), SCIPrealToRational(), SCIPresolveSolHeurSubNlp(), SCIProwCalcIntegralScalar(), SCIProwGetLPActivity(), SCIProwGetLPFeasibility(), SCIProwGetNLPFeasibility(), SCIProwGetObjParallelism(), SCIProwGetPseudoActivity(), SCIProwGetPseudoFeasibility(), SCIProwGetRelaxFeasibility(), SCIProwGetSolActivity(), SCIProwGetSolFeasibility(), SCIPselectVarPseudoStrongBranching(), SCIPselectVarStrongBranching(), SCIPsetCutoffbounddelta(), SCIPsetIsLbBetter(), SCIPsetIsUbBetter(), SCIPsetLpfeastol(), SCIPsolveCIP(), SCIPstoreSolutionGap(), SCIPtightenVarLb(), SCIPtightenVarLbGlobal(), SCIPtreeBranchVar(), SCIPtreeBranchVarNary(), SCIPtreeCalcChildEstimate(), SCIPtreeGetLowerbound(), SCIPvarChgLbGlobal(), SCIPvarChgLbLocal(), SCIPvarGetAvgSol(), SCIPvarGetMultaggrUbGlobal(), SCIPvarGetMultaggrUbLocal(), SCIPvarIsBinary(), SCIPvboundsAdd(), selectShifting(), separateCons(), separateCuts(), separateGLS(), separateHeur(), separatePoint(), separateSequLiftedMinimalCoverInequality(), sepastoreIsBdchgApplicable(), sequentialUpAndDownLifting(), sequentialUpAndDownLiftingGUB(), solveDerivativeEquation(), solveNode(), solveSubMIP(), solveSubNLP(), solveSubproblem(), solveSubscip(), sortVariables(), splitProblem(), tightenBounds(), tightenCoefs(), tightenLbTTEF(), tightenUbTTEF(), tightenWeightsLift(), turnoffNodeSelector(), updateEstimate(), varAddTransitiveBinaryClosureImplic(), varAddTransitiveImplic(), varProcessChgLbLocal(), varRemoveImplicsVbs(), and varUpdateAggregationBounds().
minimal size of a chunk (in bytes) Definition at line 466 of file memory.c. Referenced by createChunk().
maximal size of a chunk (in bytes) Definition at line 467 of file memory.c. Referenced by createChunk().
maximal number of elements in one chunk Definition at line 468 of file memory.c. Referenced by createChunk().
size of lazy free list to start garbage collection Definition at line 469 of file memory.c. Referenced by freeChkmemElement().
minimal alignment of chunks Definition at line 470 of file memory.c. Referenced by alignSize(), BMSalignMemsize(), and BMSisAligned().
Definition at line 715 of file memory.c. Referenced by allocChunkElement(), and freeChunkElement().
Definition at line 716 of file memory.c. Referenced by allocChkmemElement(), BMSallocChunkMemory_call(), BMSfreeChunkMemory_call(), createChunk(), freeChkmemElement(), and garbagecollectChkmem().
size of chunk block hash table; should be prime Definition at line 1456 of file memory.c. Referenced by BMScheckEmptyBlockMemory_call(), BMSclearBlockMemory_call(), BMScreateBlockMemory_call(), BMSdisplayBlockMemory_call(), BMSgarbagecollectBlockMemory_call(), and findChkmem().
Definition at line 1497 of file memory.c. Referenced by BMSallocBlockMemory_call(), and BMSfreeBlockMemory_call(). Typedef Documentation
Function Documentation
allocates memory and initializes it with 0; returns NULL if memory allocation failed
Definition at line 280 of file memory.c. References debugMessage, MAX, NULL, printError, and printErrorHeader.
allocates memory; returns NULL if memory allocation failed
Definition at line 309 of file memory.c. References debugMessage, MAX, NULL, printError, and printErrorHeader. Referenced by BMSduplicateMemory_call().
allocates memory; returns NULL if memory allocation failed
Definition at line 336 of file memory.c. References MAX, NULL, printError, and printErrorHeader.
copies the contents of one memory element into another memory element
Definition at line 382 of file memory.c. References NULL. Referenced by BMSduplicateMemory_call().
moves the contents of one memory element into another memory element, should be used if both elements overlap, otherwise BMScopyMemory is faster
Definition at line 399 of file memory.c. References NULL.
allocates memory and copies the contents of the given memory element into the new memory element
Definition at line 414 of file memory.c. References BMSallocMemory_call(), BMScopyMemory_call(), and NULL.
frees an allocated memory element
Definition at line 433 of file memory.c. References NULL, printError, and printErrorHeader.
aligns the given byte size corresponding to the minimal alignment
Definition at line 524 of file memory.c. References ALIGNMENT. Referenced by BMSalignMemsize(), BMSallocBlockMemory_call(), BMScreateChunkMemory_call(), BMSfreeBlockMemory_call(), and BMSreallocBlockMemory_call().
aligns the given byte size corresponding to the minimal alignment for chunk and block memory
Definition at line 535 of file memory.c. References ALIGNMENT, and alignSize().
checks whether the given size meets the alignment conditions for chunk and block memory
Definition at line 544 of file memory.c. References ALIGNMENT. Referenced by createChkmem(), createChunk(), and getHashNumber().
checks, if the given pointer belongs to the given chunk
Definition at line 555 of file memory.c. References NULL. Referenced by freeChunkElement().
given a pointer, finds the chunk this pointer points to in the chunk array of the given chunk block; binary search is used; returns NULL if the pointer does not belong to the chunk block
Definition at line 572 of file memory.c. References NULL. Referenced by garbagecollectChkmem(), and isPtrInChkmem().
checks, if a pointer belongs to a chunk of the given chunk block
Definition at line 608 of file memory.c. References findChunk(), and NULL. Referenced by findChkmem(), and freeChkmemElement().
links chunk to the block's chunk array, sort it by store pointer; returns TRUE if successful, FALSE otherwise
Definition at line 724 of file memory.c. References BMSreallocMemoryArray, debugMessage, FALSE, NULL, and TRUE. Referenced by createChunk().
unlinks chunk from the chunk block's chunk list
Definition at line 796 of file memory.c. References debugMessage, and NULL. Referenced by freeChunk().
links chunk to the chunk block's eager chunk list
Definition at line 829 of file memory.c. References NULL. Referenced by freeChunkElement().
unlinks chunk from the chunk block's eager chunk list
Definition at line 850 of file memory.c. References NULL. Referenced by allocChunkElement(), and freeChunk().
creates a new memory chunk in the given chunk block and adds memory elements to the lazy free list; returns TRUE if successful, FALSE otherwise
Definition at line 875 of file memory.c. References BMSallocMemorySize, BMSisAligned(), checkChkmem, CHUNKLENGTH_MAX, CHUNKLENGTH_MIN, debugMessage, FALSE, linkChunk(), MAX, MIN, NULL, and STORESIZE_MAX. Referenced by allocChkmemElement().
destroys a chunk without updating the chunk lists
Definition at line 946 of file memory.c. References BMSfreeMemory, debugMessage, and NULL. Referenced by clearChkmem(), and freeChunk().
removes a completely unused chunk, i.e. a chunk with all elements in the eager free list
Definition at line 960 of file memory.c. References debugMessage, destroyChunk(), NULL, unlinkChunk(), and unlinkEagerChunk(). Referenced by garbagecollectChkmem().
returns an element of the eager free list and removes it from the list
Definition at line 990 of file memory.c. References checkChunk, debugMessage, NULL, and unlinkEagerChunk(). Referenced by allocChkmemElement().
puts given pointer into the eager free list and adds the chunk to the eager list of its chunk block, if necessary
Definition at line 1027 of file memory.c. References checkChunk, debugMessage, isPtrInChunk(), linkEagerChunk(), and NULL. Referenced by garbagecollectChkmem().
creates a new chunk block data structure
Definition at line 1056 of file memory.c. References BMSallocMemory, BMSisAligned(), and NULL. Referenced by BMSallocBlockMemory_call(), and BMScreateChunkMemory_call().
destroys all chunks of the chunk block, but keeps the chunk block header structure
Definition at line 1096 of file memory.c. References destroyChunk(), and NULL. Referenced by BMSclearChunkMemory_call(), destroyChkmem(), and garbagecollectChkmem().
deletes chunk block and frees all associated memory chunks
Definition at line 1119 of file memory.c. References BMSfreeMemory, BMSfreeMemoryArrayNull, clearChkmem(), and NULL. Referenced by BMSclearBlockMemory_call(), BMSdestroyChunkMemory_call(), and BMSgarbagecollectBlockMemory_call().
allocates a new memory element from the chunk block
Definition at line 1138 of file memory.c. References allocChunkElement(), checkChkmem, createChunk(), and NULL. Referenced by BMSallocBlockMemory_call(), and BMSallocChunkMemory_call().
sorts the lazy free list of the chunk block into the eager free lists of the chunks, and removes completely unused chunks
Definition at line 1177 of file memory.c. References checkChkmem, clearChkmem(), debugMessage, errorMessage, findChunk(), freeChunk(), freeChunkElement(), and NULL. Referenced by BMSgarbagecollectBlockMemory_call(), BMSgarbagecollectChunkMemory_call(), and freeChkmemElement().
frees a memory element and returns it to the lazy freelist of the chunk block
Definition at line 1244 of file memory.c. References checkChkmem, GARBAGE_SIZE, garbagecollectChkmem(), isPtrInChkmem(), NULL, printError, and printErrorHeader. Referenced by BMSfreeBlockMemory_call(), and BMSfreeChunkMemory_call().
creates a new chunk block data structure
Definition at line 1283 of file memory.c. References alignSize(), createChkmem(), debugMessage, NULL, printError, and printErrorHeader.
clears a chunk block data structure
Definition at line 1307 of file memory.c. References clearChkmem(), debugMessage, NULL, printError, and printErrorHeader.
destroys and frees a chunk block data structure
Definition at line 1325 of file memory.c. References debugMessage, destroyChkmem(), NULL, printError, and printErrorHeader.
allocates a memory element of the given chunk block
Definition at line 1345 of file memory.c. References allocChkmemElement(), checkChkmem, debugMessage, NULL, printError, and printErrorHeader. Referenced by BMSduplicateChunkMemory_call().
duplicates a given memory element by allocating a new element of the same chunk block and copying the data
Definition at line 1372 of file memory.c. References BMSallocChunkMemory_call(), BMScopyMemorySize, and NULL.
frees a memory element of the given chunk block
Definition at line 1394 of file memory.c. References checkChkmem, debugMessage, freeChkmemElement(), NULL, printError, and printErrorHeader.
calls garbage collection of chunk block and frees chunks without allocated memory elements
Definition at line 1421 of file memory.c. References debugMessage, and garbagecollectChkmem().
finds the chunk block, to whick the given pointer belongs to; this could be done by selecting the chunk block of the corresponding element size, but in a case of an error (free gives an incorrect element size), we want to identify and output the correct element size
Definition at line 1506 of file memory.c. References CHKHASH_SIZE, isPtrInChkmem(), and NULL. Referenced by BMSgetBlockPointerSize_call().
calculates hash number of memory size
Definition at line 1529 of file memory.c. References BMSisAligned(). Referenced by BMSallocBlockMemory_call(), and BMSfreeBlockMemory_call().
creates a block memory allocation data structure
Definition at line 1539 of file memory.c. References BMSallocMemory, CHKHASH_SIZE, NULL, printError, and printErrorHeader.
frees all chunk blocks in the block memory
Definition at line 1569 of file memory.c. References CHKHASH_SIZE, destroyChkmem(), NULL, printError, and printErrorHeader. Referenced by BMSdestroyBlockMemory_call().
clears and deletes block memory
Definition at line 1602 of file memory.c. References BMSclearBlockMemory_call(), BMSfreeMemory, NULL, printError, and printErrorHeader.
allocates memory in the block memory pool
Definition at line 1624 of file memory.c. References alignSize(), allocChkmemElement(), BMSduplicateMemoryArray, checkBlkmem, createChkmem(), debugMessage, getHashNumber(), NULL, printError, and printErrorHeader. Referenced by BMSduplicateBlockMemory_call(), and BMSreallocBlockMemory_call().
resizes memory element in the block memory pool, and copies the data
Definition at line 1679 of file memory.c. References alignSize(), BMSallocBlockMemory_call(), BMScopyMemorySize, BMSfreeBlockMemory_call(), MIN, and NULL.
duplicates memory element in the block memory pool, and copies the data
Definition at line 1710 of file memory.c. References BMSallocBlockMemory_call(), BMScopyMemorySize, and NULL.
frees memory element in the block memory pool
Definition at line 1730 of file memory.c. References alignSize(), checkBlkmem, debugMessage, freeChkmemElement(), getHashNumber(), NULL, printError, and printErrorHeader. Referenced by BMSreallocBlockMemory_call().
calls garbage collection of block memory, frees chunks without allocated memory elements, and frees chunk blocks without any chunks
Definition at line 1783 of file memory.c. References CHKHASH_SIZE, destroyChkmem(), garbagecollectChkmem(), and NULL.
returns the size of the given memory element; returns 0, if the element is not member of the block memory
Definition at line 1824 of file memory.c. References findChkmem(), and NULL.
outputs allocation diagnostics of block memory
Definition at line 1844 of file memory.c. References CHKHASH_SIZE, NULL, and printInfo.
outputs warning messages, if there are allocated elements in the block memory
Definition at line 1967 of file memory.c. References CHKHASH_SIZE, NULL, and printInfo. |