40#ifndef __SCIP_SCIP_MEM_H__
41#define __SCIP_SCIP_MEM_H__
60#define SCIPallocMemory(scip,ptr) ( (BMSallocMemory((ptr)) == NULL) \
61 ? SCIP_NOMEMORY : SCIP_OKAY )
62#define SCIPallocClearMemory(scip,ptr) ( (BMSallocClearMemory((ptr)) == NULL) \
63 ? SCIP_NOMEMORY : SCIP_OKAY )
64#define SCIPallocMemoryArray(scip,ptr,num) ( (BMSallocMemoryArray((ptr), (num)) == NULL) \
65 ? SCIP_NOMEMORY : SCIP_OKAY )
66#define SCIPallocClearMemoryArray(scip,ptr,num) ( (BMSallocClearMemoryArray((ptr), (num)) == NULL) \
67 ? SCIP_NOMEMORY : SCIP_OKAY )
68#define SCIPallocMemorySize(scip,ptr,size) ( (BMSallocMemorySize((ptr), (size)) == NULL) \
69 ? SCIP_NOMEMORY : SCIP_OKAY )
70#define SCIPreallocMemoryArray(scip,ptr,newnum) ( (BMSreallocMemoryArray((ptr), (newnum)) == NULL) \
71 ? SCIP_NOMEMORY : SCIP_OKAY )
72#define SCIPreallocMemorySize(scip,ptr,newsize) ( (BMSreallocMemorySize((ptr), (newsize)) == NULL) \
73 ? SCIP_NOMEMORY : SCIP_OKAY )
74#define SCIPduplicateMemory(scip, ptr, source) ( (BMSduplicateMemory((ptr), (source)) == NULL) \
75 ? SCIP_NOMEMORY : SCIP_OKAY )
76#define SCIPduplicateMemoryArray(scip, ptr, source, num) ( (BMSduplicateMemoryArray((ptr), (source), (num)) == NULL) \
77 ? SCIP_NOMEMORY : SCIP_OKAY )
78#define SCIPfreeMemory(scip,ptr) BMSfreeMemory(ptr)
79#define SCIPfreeMemoryNull(scip,ptr) BMSfreeMemoryNull(ptr)
80#define SCIPfreeMemoryArray(scip,ptr) BMSfreeMemoryArray(ptr)
81#define SCIPfreeMemoryArrayNull(scip,ptr) BMSfreeMemoryArrayNull(ptr)
82#define SCIPfreeMemorySize(scip,ptr) BMSfreeMemorySize(ptr)
83#define SCIPfreeMemorySizeNull(scip,ptr) BMSfreeMemorySizeNull(ptr)
89#define SCIPallocBlockMemory(scip,ptr) ( (BMSallocBlockMemory(SCIPblkmem(scip), (ptr)) == NULL) \
90 ? SCIP_NOMEMORY : SCIP_OKAY )
91#define SCIPallocClearBlockMemory(scip,ptr) ( (BMSallocClearBlockMemory(SCIPblkmem(scip), (ptr)) == NULL) \
92 ? SCIP_NOMEMORY : SCIP_OKAY )
93#define SCIPallocBlockMemoryArray(scip,ptr,num) ( (BMSallocBlockMemoryArray(SCIPblkmem(scip), (ptr), (num)) == NULL) \
94 ? SCIP_NOMEMORY : SCIP_OKAY )
95#define SCIPallocBlockMemorySize(scip,ptr,size) ( (BMSallocBlockMemorySize(SCIPblkmem(scip), (ptr), (size)) == NULL) \
96 ? SCIP_NOMEMORY : SCIP_OKAY )
97#define SCIPallocClearBlockMemoryArray(scip,ptr,num) ( (BMSallocClearBlockMemoryArray(SCIPblkmem(scip), (ptr), (num)) == NULL) \
98 ? SCIP_NOMEMORY : SCIP_OKAY )
99#define SCIPreallocBlockMemoryArray(scip,ptr,oldnum,newnum) ( (BMSreallocBlockMemoryArray(SCIPblkmem(scip), (ptr), (oldnum), (newnum)) == NULL) \
100 ? SCIP_NOMEMORY : SCIP_OKAY )
101#define SCIPreallocBlockMemorySize(scip,ptr,oldsize,newsize) ( (BMSreallocBlockMemorySize(SCIPblkmem(scip), (ptr), (oldsize), (newsize)) == NULL) \
102 ? SCIP_NOMEMORY : SCIP_OKAY )
103#define SCIPduplicateBlockMemory(scip, ptr, source) ( (BMSduplicateBlockMemory(SCIPblkmem(scip), (ptr), (source)) == NULL) \
104 ? SCIP_NOMEMORY : SCIP_OKAY )
105#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num) ( (BMSduplicateBlockMemoryArray(SCIPblkmem(scip), (ptr), (source), (num)) == NULL) \
106 ? SCIP_NOMEMORY : SCIP_OKAY )
107#define SCIPensureBlockMemoryArray(scip,ptr,arraysizeptr,minsize) ( (SCIPensureBlockMemoryArray_call((scip), (void**)(ptr), sizeof(**(ptr)), (arraysizeptr), (minsize))) )
108#define SCIPfreeBlockMemory(scip,ptr) BMSfreeBlockMemory(SCIPblkmem(scip), (ptr))
109#define SCIPfreeBlockMemoryNull(scip,ptr) BMSfreeBlockMemoryNull(SCIPblkmem(scip), (ptr))
110#define SCIPfreeBlockMemoryArray(scip,ptr,num) BMSfreeBlockMemoryArray(SCIPblkmem(scip), (ptr), (num))
111#define SCIPfreeBlockMemoryArrayNull(scip,ptr,num) BMSfreeBlockMemoryArrayNull(SCIPblkmem(scip), (ptr), (num))
112#define SCIPfreeBlockMemorySize(scip,ptr,size) BMSfreeBlockMemorySize(SCIPblkmem(scip), (ptr), (size))
113#define SCIPfreeBlockMemorySizeNull(scip,ptr,size) BMSfreeBlockMemorySizeNull(SCIPblkmem(scip), (ptr), (size))
122#define SCIPallocBuffer(scip,ptr) ( (BMSallocBufferMemory(SCIPbuffer(scip), (ptr)) == NULL) \
123 ? SCIP_NOMEMORY : SCIP_OKAY )
124#define SCIPallocBufferArray(scip,ptr,num) ( (BMSallocBufferMemoryArray(SCIPbuffer(scip), (ptr), (num)) == NULL) \
125 ? SCIP_NOMEMORY : SCIP_OKAY )
126#define SCIPallocClearBufferArray(scip,ptr,num) ( (BMSallocClearBufferMemoryArray(SCIPbuffer(scip), (ptr), (num)) == NULL) \
127 ? SCIP_NOMEMORY : SCIP_OKAY )
128#define SCIPreallocBufferArray(scip,ptr,num) ( (BMSreallocBufferMemoryArray(SCIPbuffer(scip), (ptr), (num)) == NULL) \
129 ? SCIP_NOMEMORY : SCIP_OKAY )
130#define SCIPduplicateBuffer(scip,ptr,source) ( (BMSduplicateBufferMemory(SCIPbuffer(scip), (ptr), (source), (size_t)sizeof(**(ptr))) \
131 ? SCIP_NOMEMORY : SCIP_OKAY )
132#define SCIPduplicateBufferArray(scip,ptr,source,num) ( (BMSduplicateBufferMemoryArray(SCIPbuffer(scip), (ptr), (source), (num)) == NULL) \
133 ? SCIP_NOMEMORY : SCIP_OKAY )
134#define SCIPfreeBuffer(scip,ptr) BMSfreeBufferMemorySize(SCIPbuffer(scip), (ptr))
135#define SCIPfreeBufferNull(scip,ptr) BMSfreeBufferMemoryNull(SCIPbuffer(scip), (ptr))
136#define SCIPfreeBufferArray(scip,ptr) BMSfreeBufferMemoryArray(SCIPbuffer(scip), (ptr))
137#define SCIPfreeBufferArrayNull(scip,ptr) BMSfreeBufferMemoryArrayNull(SCIPbuffer(scip), (ptr))
140#define SCIPallocCleanBuffer(scip,ptr) ( (BMSallocBufferMemory(SCIPcleanbuffer(scip), (ptr)) == NULL) \
141 ? SCIP_NOMEMORY : SCIP_OKAY )
142#define SCIPallocCleanBufferArray(scip,ptr,num) ( (BMSallocBufferMemoryArray(SCIPcleanbuffer(scip), (ptr), (num)) == NULL) \
143 ? SCIP_NOMEMORY : SCIP_OKAY )
144#define SCIPfreeCleanBuffer(scip,ptr) BMSfreeBufferMemorySize(SCIPcleanbuffer(scip), (ptr))
145#define SCIPfreeCleanBufferNull(scip,ptr) BMSfreeBufferMemoryNull(SCIPcleanbuffer(scip), (ptr))
146#define SCIPfreeCleanBufferArray(scip,ptr) BMSfreeBufferMemoryArray(SCIPcleanbuffer(scip), (ptr))
147#define SCIPfreeCleanBufferArrayNull(scip,ptr) BMSfreeBufferMemoryArrayNull(SCIPcleanbuffer(scip), (ptr))
common defines and data types used in all packages of SCIP
void SCIPprintMemoryDiagnostic(SCIP *scip)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
BMS_BUFMEM * SCIPcleanbuffer(SCIP *scip)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_RETCODE SCIPensureBlockMemoryArray_call(SCIP *scip, void **arrayptr, size_t elemsize, int *arraysize, int minsize)
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
memory allocation routines
struct BMS_BlkMem BMS_BLKMEM
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
type definitions for SCIP's main datastructure