Skip to content

Commit c0c1777

Browse files
committed
Merge remote-tracking branch 'origin/v10-minor'
2 parents 0a7952a + 94f0073 commit c0c1777

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ Interface changes
230230
- SCIPvarGetMinAggrCoef() and SCIPvarGetMaxAggrCoef() to get bounds on absolute aggregation coefficients for a loose variable;
231231
SCIPisVarAggrCoefAcceptable() to check whether bounds on aggregation coefficients would exceed thresholds when using a loose variable in another aggregation
232232
- SCIPgetNRootIntFixings() to retrieve the number of integer fixings at the root node
233+
- added SCIPcollectMemoryGarbage() to explicitly trigger garbage collection on block memory; before SCIP 10, this was done in SCIPtransformProb()
233234

234235
### Changes in preprocessor macros
235236

src/scip/scip_mem.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,21 @@ void SCIPprintMemoryDiagnostic(
200200
SCIPmessagePrintInfo(scip->messagehdlr, "\nClean Memory Buffers:\n");
201201
BMSprintBufferMemory(SCIPcleanbuffer(scip));
202202
}
203+
204+
/** run garbage collection on block memory
205+
*
206+
* For both settings and problems block memory, frees unused chunks in chunk blocks
207+
* and frees chunk blocks that have no chunks by calling BMSgarbagecollectBlockMemory().
208+
* Note that the former (freeing unused chunks) is also done automatically when a
209+
* chunk block has many unused chunks.
210+
*/
211+
void SCIPcollectMemoryGarbage(
212+
SCIP* scip /**< SCIP data structure */
213+
)
214+
{
215+
assert(scip != NULL);
216+
assert(scip->mem != NULL);
217+
218+
BMSgarbagecollectBlockMemory(scip->mem->setmem);
219+
BMSgarbagecollectBlockMemory(scip->mem->probmem);
220+
}

src/scip/scip_mem.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,18 @@ void SCIPprintMemoryDiagnostic(
237237
SCIP* scip /**< SCIP data structure */
238238
);
239239

240+
/** run garbage collection on block memory
241+
*
242+
* For both settings and problems block memory, frees unused chunks in chunk blocks
243+
* and frees chunk blocks that have no chunks by calling BMSgarbagecollectBlockMemory().
244+
* Note that the former (freeing unused chunks) is also done automatically when a
245+
* chunk block has many unused chunks.
246+
*/
247+
SCIP_EXPORT
248+
void SCIPcollectMemoryGarbage(
249+
SCIP* scip /**< SCIP data structure */
250+
);
251+
240252
/** @} */
241253

242254
#ifdef __cplusplus

src/scip/scip_solve.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,6 @@ SCIP_RETCODE SCIPtransformProb(
250250
return SCIP_PLUGINNOTFOUND;
251251
}
252252

253-
/* call garbage collector on original problem and parameter settings memory spaces */
254-
BMSgarbagecollectBlockMemory(scip->mem->setmem);
255-
BMSgarbagecollectBlockMemory(scip->mem->probmem);
256-
257253
/* remember number of constraints */
258254
SCIPprobMarkNConss(scip->origprob);
259255

0 commit comments

Comments
 (0)