#ifndef __BMS_MEMORY_H__
#define __BMS_MEMORY_H__
#include <limits.h>
#include <stdlib.h>
#include <stddef.h>
#ifndef NO_CONFIG_HEADER
#include "scip/config.h"
#include "scip/scip_export.h"
#endif
#ifdef __cplusplus
template<typename T> T* docast(T*, void *v);
template<typename T> T* docast(T*, void *v) { return reinterpret_cast<T*>(v); }
#if __cplusplus > 199711L
#include <type_traits>
template<typename T1, typename T2> T1* docastcheck(T1* v1, void* v, T2* v2)
{
typedef typename std::remove_const<T1>::type t1;
typedef typename std::remove_const<T2>::type t2;
static_assert(std::is_same<t1, t2>::value, "need equal types");
return reinterpret_cast<T1*>(v);
}
#else
template<typename T1, typename T2> T1* docastcheck(T1* v1, void* v, T2* v2) { return reinterpret_cast<T1*>(v); }
#endif
extern "C" {
#define ASSIGN(pointerstarstar, voidstarfunction) (*(pointerstarstar) = docast(*(pointerstarstar), (voidstarfunction)))
#define ASSIGNCHECK(pointerstarstar, voidstarfunction, origpointer) (*(pointerstarstar) = docastcheck(*(pointerstarstar), (voidstarfunction), (origpointer)))
#else
#define ASSIGN(pointerstarstar, voidstarfunction) (*(pointerstarstar) = (voidstarfunction))
#define ASSIGNCHECK(pointerstarstar, voidstarfunction, origpointer) (*(pointerstarstar) = (voidstarfunction))
#endif
#ifndef SCIP_EXPORT
#if defined(_WIN32) || defined(_WIN64)
#define SCIP_EXPORT __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
#define SCIP_EXPORT __attribute__((__visibility__("default")))
#else
#define SCIP_EXPORT
#endif
#endif
#ifndef SCIP_UNUSED
#define SCIP_UNUSED(x) ((void) (x))
#endif
#define BMSallocMemory(ptr) ASSIGN((ptr), BMSallocMemory_call( sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSallocClearMemory(ptr) ASSIGN((ptr), BMSallocClearMemory_call((size_t)(1), sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSallocMemorySize(ptr,size) ASSIGN((ptr), BMSallocMemory_call( (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ ))
#define BMSallocMemoryCPP(size) BMSallocMemory_call( (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ )
#define BMSallocClearMemorySize(ptr,size) ASSIGN((ptr), BMSallocClearMemory_call((size_t)(1), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ ))
#define BMSallocMemoryArray(ptr,num) ASSIGN((ptr), BMSallocMemoryArray_call((size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSallocMemoryArrayCPP(num,size) BMSallocMemoryArray_call( (size_t)(ptrdiff_t)(num), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ )
#define BMSallocClearMemoryArray(ptr,num) ASSIGN((ptr), BMSallocClearMemory_call((size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSreallocMemorySize(ptr,size) ASSIGN((ptr), BMSreallocMemory_call((void*)(*(ptr)), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ ))
#define BMSreallocMemoryArray(ptr,num) ASSIGN((ptr), BMSreallocMemoryArray_call( *(ptr), (size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSclearMemory(ptr) BMSclearMemory_call( (void*)(ptr), sizeof(*(ptr)) )
#define BMSclearMemoryArray(ptr, num) BMSclearMemory_call( (void*)(ptr), (size_t)(ptrdiff_t)(num)*sizeof(*(ptr)) )
#define BMSclearMemorySize(ptr, size) BMSclearMemory_call( (void*)(ptr), (size_t)(ptrdiff_t)(size) )
#define BMScopyMemory(ptr, source) BMScopyMemory_call( (void*)(ptr), (const void*)(source), sizeof(*(ptr)) )
#define BMScopyMemoryArray(ptr, source, num) BMScopyMemory_call( (void*)(ptr), (const void*)(source), (size_t)(ptrdiff_t)(num)*sizeof(*(ptr)) )
#define BMScopyMemorySize(ptr, source, size) BMScopyMemory_call( (void*)(ptr), (const void*)(source), (size_t)(ptrdiff_t)(size) )
#define BMSmoveMemory(ptr, source) BMSmoveMemory_call( (void*)(ptr), (const void*)(source), sizeof(*(ptr)) )
#define BMSmoveMemoryArray(ptr, source, num) BMSmoveMemory_call( (void*)(ptr), (const void*)(source), (size_t)(ptrdiff_t)(num) * sizeof(*(ptr)) )
#define BMSmoveMemorySize(ptr, source, size) BMSmoveMemory_call( (void*)(ptr), (const void*)(source), (size_t)(ptrdiff_t)(size) )
#define BMSduplicateMemory(ptr, source) ASSIGN((ptr), BMSduplicateMemory_call( (const void*)(source), sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSduplicateMemorySize(ptr, source, size) ASSIGN((ptr), BMSduplicateMemory_call( (const void*)(source), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ ))
#define BMSduplicateMemoryArray(ptr, source, num) ASSIGNCHECK((ptr), BMSduplicateMemoryArray_call( (const void*)(source), (size_t)(ptrdiff_t)(num), \
sizeof(**(ptr)), __FILE__, __LINE__ ), source)
#define BMSfreeMemory(ptr) BMSfreeMemory_call( (void**)(ptr), __FILE__, __LINE__ )
#define BMSfreeMemoryNull(ptr) BMSfreeMemoryNull_call( (void**)(ptr), __FILE__, __LINE__ )
#define BMSfreeMemoryArray(ptr) BMSfreeMemory_call( (void**)(ptr), __FILE__, __LINE__ )
#define BMSfreeMemoryArrayNull(ptr) BMSfreeMemoryNull_call( (void**)(ptr), __FILE__, __LINE__ )
#define BMSfreeMemorySize(ptr) BMSfreeMemory_call( (void**)(ptr), __FILE__, __LINE__ )
#define BMSfreeMemorySizeNull(ptr) BMSfreeMemoryNull_call( (void**)(ptr), __FILE__, __LINE__ )
#ifndef NDEBUG
#define BMSgetPointerSize(ptr) BMSgetPointerSize_call(ptr)
#define BMSdisplayMemory() BMSdisplayMemory_call()
#define BMScheckEmptyMemory() BMScheckEmptyMemory_call()
#define BMSgetMemoryUsed() BMSgetMemoryUsed_call()
#else
#define BMSgetPointerSize(ptr) 0
#define BMSdisplayMemory()
#define BMScheckEmptyMemory()
#define BMSgetMemoryUsed() 0LL
#endif
SCIP_EXPORT
void* BMSallocClearMemory_call(
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocMemory_call(
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocMemoryArray_call(
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSreallocMemory_call(
void* ptr,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSreallocMemoryArray_call(
void* ptr,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void BMSclearMemory_call(
void* ptr,
size_t size
);
SCIP_EXPORT
void BMScopyMemory_call(
void* ptr,
const void* source,
size_t size
);
SCIP_EXPORT
void BMSmoveMemory_call(
void* ptr,
const void* source,
size_t size
);
SCIP_EXPORT
void* BMSduplicateMemory_call(
const void* source,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSduplicateMemoryArray_call(
const void* source,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeMemory_call(
void** ptr,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeMemoryNull_call(
void** ptr,
const char* filename,
int line
);
SCIP_EXPORT
size_t BMSgetPointerSize_call(
const void* ptr
);
SCIP_EXPORT
void BMSdisplayMemory_call(
void
);
SCIP_EXPORT
void BMScheckEmptyMemory_call(
void
);
SCIP_EXPORT
long long BMSgetMemoryUsed_call(
void
);
typedef struct BMS_ChkMem BMS_CHKMEM;
#ifndef BMS_NOBLOCKMEM
#define BMScreateChunkMemory(sz,isz,gbf) BMScreateChunkMemory_call( (sz), (isz), (gbf), __FILE__, __LINE__ )
#define BMSclearChunkMemory(mem) BMSclearChunkMemory_call( (mem), __FILE__, __LINE__ )
#define BMSdestroyChunkMemory(mem) BMSdestroyChunkMemory_call( (mem), __FILE__, __LINE__ )
#define BMSallocChunkMemory(mem,ptr) ASSIGN((ptr), BMSallocChunkMemory_call((mem), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSduplicateChunkMemory(mem, ptr, source) ASSIGN((ptr), BMSduplicateChunkMemory_call((mem), (const void*)(source), \
sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSfreeChunkMemory(mem,ptr) BMSfreeChunkMemory_call( (mem), (void**)(ptr), sizeof(**(ptr)), __FILE__, __LINE__ )
#define BMSfreeChunkMemoryNull(mem,ptr) BMSfreeChunkMemoryNull_call( (mem), (void**)(ptr), sizeof(**(ptr)), __FILE__, __LINE__ )
#define BMSgarbagecollectChunkMemory(mem) BMSgarbagecollectChunkMemory_call(mem)
#define BMSgetChunkMemoryUsed(mem) BMSgetChunkMemoryUsed_call(mem)
#else
#define BMScreateChunkMemory(sz,isz,gbf) (void*)(0x01)
#define BMSclearChunkMemory(mem)
#define BMSclearChunkMemoryNull(mem)
#define BMSdestroyChunkMemory(mem)
#define BMSdestroyChunkMemoryNull(mem)
#define BMSallocChunkMemory(mem,ptr) BMSallocMemory(ptr)
#define BMSduplicateChunkMemory(mem, ptr, source) BMSduplicateMemory(ptr,source)
#define BMSfreeChunkMemory(mem,ptr) BMSfreeMemory(ptr)
#define BMSfreeChunkMemoryNull(mem,ptr) BMSfreeMemoryNull(ptr)
#define BMSgarbagecollectChunkMemory(mem)
#define BMSgetChunkMemoryUsed(mem) 0LL
#endif
SCIP_EXPORT
void BMSalignMemsize(
size_t* size
);
SCIP_EXPORT
int BMSisAligned(
size_t size
);
SCIP_EXPORT
BMS_CHKMEM* BMScreateChunkMemory_call(
size_t size,
int initchunksize,
int garbagefactor,
const char* filename,
int line
);
SCIP_EXPORT
void BMSclearChunkMemory_call(
BMS_CHKMEM* chkmem,
const char* filename,
int line
);
SCIP_EXPORT
void BMSdestroyChunkMemory_call(
BMS_CHKMEM** chkmem,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocChunkMemory_call(
BMS_CHKMEM* chkmem,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSduplicateChunkMemory_call(
BMS_CHKMEM* chkmem,
const void* source,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeChunkMemory_call(
BMS_CHKMEM* chkmem,
void** ptr,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeChunkMemoryNull_call(
BMS_CHKMEM* chkmem,
void** ptr,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void BMSgarbagecollectChunkMemory_call(
BMS_CHKMEM* chkmem
);
SCIP_EXPORT
long long BMSgetChunkMemoryUsed_call(
const BMS_CHKMEM* chkmem
);
typedef struct BMS_BlkMem BMS_BLKMEM;
#ifndef BMS_NOBLOCKMEM
#define BMScreateBlockMemory(csz,gbf) BMScreateBlockMemory_call( (csz), (gbf), __FILE__, __LINE__ )
#define BMSclearBlockMemory(mem) BMSclearBlockMemory_call( (mem), __FILE__, __LINE__ )
#define BMSdestroyBlockMemory(mem) BMSdestroyBlockMemory_call( (mem), __FILE__, __LINE__ )
#define BMSallocBlockMemory(mem,ptr) ASSIGN((ptr), BMSallocBlockMemory_call((mem), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSallocClearBlockMemory(mem,ptr) ASSIGN((ptr), BMSallocClearBlockMemory_call((mem), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSallocBlockMemorySize(mem,ptr,size) ASSIGN((ptr), BMSallocBlockMemory_call((mem), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__))
#define BMSallocBlockMemoryArray(mem,ptr,num) ASSIGN((ptr), BMSallocBlockMemoryArray_call((mem), (size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSallocClearBlockMemoryArray(mem,ptr,num) ASSIGN((ptr), BMSallocClearBlockMemoryArray_call((mem), (size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSreallocBlockMemorySize(mem,ptr,oldsize,newsize) ASSIGN((ptr), BMSreallocBlockMemory_call((mem), (void*)(*(ptr)), \
(size_t)(ptrdiff_t)(oldsize), (size_t)(ptrdiff_t)(newsize), __FILE__, __LINE__))
#define BMSreallocBlockMemoryArray(mem,ptr,oldnum,newnum) ASSIGN((ptr), BMSreallocBlockMemoryArray_call((mem), (void*)(*(ptr)), \
(size_t)(ptrdiff_t)(oldnum), (size_t)(ptrdiff_t)(newnum), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSduplicateBlockMemory(mem, ptr, source) ASSIGN((ptr), BMSduplicateBlockMemory_call((mem), (const void*)(source), \
sizeof(**(ptr)), __FILE__, __LINE__ ))
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num) ASSIGNCHECK((ptr), BMSduplicateBlockMemoryArray_call( (mem), (const void*)(source), \
(size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__ ), source)
#define BMSfreeBlockMemory(mem,ptr) BMSfreeBlockMemory_call( (mem), (void**)(ptr), sizeof(**(ptr)), __FILE__, __LINE__ )
#define BMSfreeBlockMemoryNull(mem,ptr) BMSfreeBlockMemoryNull_call( (mem), (void**)(ptr), sizeof(**(ptr)), __FILE__, __LINE__ )
#define BMSfreeBlockMemoryArray(mem,ptr,num) BMSfreeBlockMemory_call( (mem), (void**)(ptr), (num)*sizeof(**(ptr)), __FILE__, __LINE__ )
#define BMSfreeBlockMemoryArrayNull(mem,ptr,num) BMSfreeBlockMemoryNull_call( (mem), (void**)(ptr), (num)*sizeof(**(ptr)), __FILE__, __LINE__ )
#define BMSfreeBlockMemorySize(mem,ptr,size) BMSfreeBlockMemory_call( (mem), (void**)(ptr), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ )
#define BMSfreeBlockMemorySizeNull(mem,ptr,size) BMSfreeBlockMemory_call( (mem), (void**)(ptr), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__ )
#define BMSgarbagecollectBlockMemory(mem) BMSgarbagecollectBlockMemory_call(mem)
#define BMSgetBlockMemoryAllocated(mem) BMSgetBlockMemoryAllocated_call(mem)
#define BMSgetBlockMemoryUsed(mem) BMSgetBlockMemoryUsed_call(mem)
#define BMSgetBlockMemoryUnused(mem) BMSgetBlockMemoryUnused_call(mem)
#define BMSgetBlockMemoryUsedMax(mem) BMSgetBlockMemoryUsedMax_call(mem)
#define BMSgetBlockMemoryUnusedMax(mem) BMSgetBlockMemoryUnusedMax_call(mem)
#define BMSgetBlockMemoryAllocatedMax(mem) BMSgetBlockMemoryAllocatedMax_call(mem)
#define BMSgetBlockPointerSize(mem,ptr) BMSgetBlockPointerSize_call((mem), (ptr))
#define BMSdisplayBlockMemory(mem) BMSdisplayBlockMemory_call(mem)
#define BMSblockMemoryCheckEmpty(mem) BMScheckEmptyBlockMemory_call(mem)
#else
#define BMScreateBlockMemory(csz,gbf) (SCIP_UNUSED(csz), SCIP_UNUSED(gbf), (void*)(0x01))
#define BMSclearBlockMemory(mem) SCIP_UNUSED(mem)
#define BMSclearBlockMemoryNull(mem) SCIP_UNUSED(mem)
#define BMSdestroyBlockMemory(mem) SCIP_UNUSED(mem)
#define BMSdestroyBlockMemoryNull(mem) SCIP_UNUSED(mem)
#define BMSallocBlockMemory(mem,ptr) (SCIP_UNUSED(mem), BMSallocMemory(ptr))
#define BMSallocClearBlockMemory(mem,ptr) (SCIP_UNUSED(mem), BMSallocClearMemory(ptr))
#define BMSallocBlockMemoryArray(mem,ptr,num) (SCIP_UNUSED(mem), BMSallocMemoryArray(ptr,num))
#define BMSallocClearBlockMemoryArray(mem,ptr,num) (SCIP_UNUSED(mem), BMSallocClearMemoryArray(ptr,num))
#define BMSallocBlockMemorySize(mem,ptr,size) (SCIP_UNUSED(mem), BMSallocMemorySize(ptr,size))
#define BMSreallocBlockMemoryArray(mem,ptr,oldnum,newnum) (SCIP_UNUSED(mem), SCIP_UNUSED(oldnum), BMSreallocMemoryArray(ptr,newnum))
#define BMSreallocBlockMemorySize(mem,ptr,oldsize,newsize) (SCIP_UNUSED(mem), SCIP_UNUSED(oldsize), BMSreallocMemorySize(ptr,newsize))
#define BMSduplicateBlockMemory(mem, ptr, source) (SCIP_UNUSED(mem), BMSduplicateMemory(ptr,source))
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num) (SCIP_UNUSED(mem), BMSduplicateMemoryArray(ptr,source,num))
#define BMSfreeBlockMemory(mem,ptr) (SCIP_UNUSED(mem), BMSfreeMemory(ptr))
#define BMSfreeBlockMemoryNull(mem,ptr) (SCIP_UNUSED(mem), BMSfreeMemoryNull(ptr))
#define BMSfreeBlockMemoryArray(mem,ptr,num) (SCIP_UNUSED(mem), SCIP_UNUSED(num), BMSfreeMemoryArray(ptr))
#define BMSfreeBlockMemoryArrayNull(mem,ptr,num) (SCIP_UNUSED(mem), SCIP_UNUSED(num), BMSfreeMemoryArrayNull(ptr))
#define BMSfreeBlockMemorySize(mem,ptr,size) (SCIP_UNUSED(mem), SCIP_UNUSED(size), BMSfreeMemory(ptr))
#define BMSfreeBlockMemorySizeNull(mem,ptr,size) (SCIP_UNUSED(mem), SCIP_UNUSED(size), BMSfreeMemoryNull(ptr))
#define BMSgarbagecollectBlockMemory(mem) SCIP_UNUSED(mem)
#define BMSgetBlockMemoryAllocated(mem) (SCIP_UNUSED(mem), 0LL)
#define BMSgetBlockMemoryUsed(mem) (SCIP_UNUSED(mem), 0LL)
#define BMSgetBlockMemoryUnused(mem) (SCIP_UNUSED(mem), 0LL)
#define BMSgetBlockMemoryUsedMax(mem) (SCIP_UNUSED(mem), 0LL)
#define BMSgetBlockMemoryUnusedMax(mem) (SCIP_UNUSED(mem), 0LL)
#define BMSgetBlockMemoryAllocatedMax(mem) (SCIP_UNUSED(mem), 0LL)
#define BMSgetBlockPointerSize(mem,ptr) (SCIP_UNUSED(mem), SCIP_UNUSED(ptr), 0)
#define BMSdisplayBlockMemory(mem) SCIP_UNUSED(mem)
#define BMSblockMemoryCheckEmpty(mem) (SCIP_UNUSED(mem), 0LL)
#endif
SCIP_EXPORT
BMS_BLKMEM* BMScreateBlockMemory_call(
int initchunksize,
int garbagefactor,
const char* filename,
int line
);
SCIP_EXPORT
void BMSclearBlockMemory_call(
BMS_BLKMEM* blkmem,
const char* filename,
int line
);
SCIP_EXPORT
void BMSdestroyBlockMemory_call(
BMS_BLKMEM** blkmem,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocBlockMemory_call(
BMS_BLKMEM* blkmem,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocClearBlockMemory_call(
BMS_BLKMEM* blkmem,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocBlockMemoryArray_call(
BMS_BLKMEM* blkmem,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocClearBlockMemoryArray_call(
BMS_BLKMEM* blkmem,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSreallocBlockMemory_call(
BMS_BLKMEM* blkmem,
void* ptr,
size_t oldsize,
size_t newsize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSreallocBlockMemoryArray_call(
BMS_BLKMEM* blkmem,
void* ptr,
size_t oldnum,
size_t newnum,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSduplicateBlockMemory_call(
BMS_BLKMEM* blkmem,
const void* source,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSduplicateBlockMemoryArray_call(
BMS_BLKMEM* blkmem,
const void* source,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeBlockMemory_call(
BMS_BLKMEM* blkmem,
void** ptr,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeBlockMemoryNull_call(
BMS_BLKMEM* blkmem,
void** ptr,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void BMSgarbagecollectBlockMemory_call(
BMS_BLKMEM* blkmem
);
SCIP_EXPORT
long long BMSgetBlockMemoryAllocated_call(
const BMS_BLKMEM* blkmem
);
SCIP_EXPORT
long long BMSgetBlockMemoryUsed_call(
const BMS_BLKMEM* blkmem
);
SCIP_EXPORT
long long BMSgetBlockMemoryUnused_call(
const BMS_BLKMEM* blkmem
);
SCIP_EXPORT
long long BMSgetBlockMemoryUsedMax_call(
const BMS_BLKMEM* blkmem
);
SCIP_EXPORT
long long BMSgetBlockMemoryUnusedMax_call(
const BMS_BLKMEM* blkmem
);
long long BMSgetBlockMemoryAllocatedMax_call(
const BMS_BLKMEM* blkmem
);
SCIP_EXPORT
size_t BMSgetBlockPointerSize_call(
const BMS_BLKMEM* blkmem,
const void* ptr
);
SCIP_EXPORT
void BMSdisplayBlockMemory_call(
const BMS_BLKMEM* blkmem
);
SCIP_EXPORT
long long BMScheckEmptyBlockMemory_call(
const BMS_BLKMEM* blkmem
);
typedef struct BMS_BufMem BMS_BUFMEM;
#define BMSallocBufferMemory(mem,ptr) ASSIGN((ptr), BMSallocBufferMemory_call((mem), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSallocBufferMemorySize(mem,ptr,size) ASSIGN((ptr), BMSallocBufferMemory_call((mem), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__))
#define BMSreallocBufferMemorySize(mem,ptr,size) \
ASSIGN((ptr), BMSreallocBufferMemory_call((mem), (void*)(*(ptr)), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__))
#define BMSallocBufferMemoryArray(mem,ptr,num) ASSIGN((ptr), BMSallocBufferMemoryArray_call((mem), (size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSallocClearBufferMemoryArray(mem,ptr,num) ASSIGN((ptr), BMSallocClearBufferMemoryArray_call((mem), (size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSreallocBufferMemoryArray(mem,ptr,num) ASSIGN((ptr), BMSreallocBufferMemoryArray_call((mem), (void*)(*(ptr)), (size_t)(ptrdiff_t)(num), \
sizeof(**(ptr)), __FILE__, __LINE__))
#define BMSduplicateBufferMemory(mem,ptr,source,size) \
ASSIGN((ptr), BMSduplicateBufferMemory_call((mem), (const void*)(source), (size_t)(ptrdiff_t)(size), __FILE__, __LINE__))
#define BMSduplicateBufferMemoryArray(mem,ptr,source,num) ASSIGNCHECK((ptr), BMSduplicateBufferMemoryArray_call((mem), \
(const void*)(source), (size_t)(ptrdiff_t)(num), sizeof(**(ptr)), __FILE__, __LINE__), source)
#define BMSfreeBufferMemory(mem,ptr) BMSfreeBufferMemory_call((mem), (void**)(ptr), __FILE__, __LINE__)
#define BMSfreeBufferMemoryNull(mem,ptr) BMSfreeBufferMemoryNull_call((mem), (void**)(ptr), __FILE__, __LINE__)
#define BMSfreeBufferMemoryArray(mem,ptr) BMSfreeBufferMemory_call((mem), (void**)(ptr), __FILE__, __LINE__)
#define BMSfreeBufferMemoryArrayNull(mem,ptr) BMSfreeBufferMemoryNull_call((mem), (void**)(ptr), __FILE__, __LINE__)
#define BMSfreeBufferMemorySize(mem,ptr) BMSfreeBufferMemory_call((mem), (void**)(ptr), __FILE__, __LINE__);
#define BMSfreeBufferMemorySizeNull(mem,ptr) BMSfreeBufferMemoryNull_call((mem), (void**)(ptr), __FILE__, __LINE__)
#define BMScreateBufferMemory(fac,init,clean) BMScreateBufferMemory_call((fac), (init), (clean), __FILE__, __LINE__)
#define BMSdestroyBufferMemory(mem) BMSdestroyBufferMemory_call((mem), __FILE__, __LINE__)
SCIP_EXPORT
BMS_BUFMEM* BMScreateBufferMemory_call(
double arraygrowfac,
int arraygrowinit,
unsigned int clean,
const char* filename,
int line
);
SCIP_EXPORT
void BMSdestroyBufferMemory_call(
BMS_BUFMEM** buffer,
const char* filename,
int line
);
SCIP_EXPORT
void BMSsetBufferMemoryArraygrowfac(
BMS_BUFMEM* buffer,
double arraygrowfac
);
SCIP_EXPORT
void BMSsetBufferMemoryArraygrowinit(
BMS_BUFMEM* buffer,
int arraygrowinit
);
SCIP_EXPORT
void* BMSallocBufferMemory_call(
BMS_BUFMEM* buffer,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocBufferMemoryArray_call(
BMS_BUFMEM* buffer,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSallocClearBufferMemoryArray_call(
BMS_BUFMEM* buffer,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSreallocBufferMemory_call(
BMS_BUFMEM* buffer,
void* ptr,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSreallocBufferMemoryArray_call(
BMS_BUFMEM* buffer,
void* ptr,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSduplicateBufferMemory_call(
BMS_BUFMEM* buffer,
const void* source,
size_t size,
const char* filename,
int line
);
SCIP_EXPORT
void* BMSduplicateBufferMemoryArray_call(
BMS_BUFMEM* buffer,
const void* source,
size_t num,
size_t typesize,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeBufferMemory_call(
BMS_BUFMEM* buffer,
void** ptr,
const char* filename,
int line
);
SCIP_EXPORT
void BMSfreeBufferMemoryNull_call(
BMS_BUFMEM* buffer,
void** ptr,
const char* filename,
int line
);
SCIP_EXPORT
size_t BMSgetNUsedBufferMemory(
BMS_BUFMEM* buffer
);
SCIP_EXPORT
long long BMSgetBufferMemoryUsed(
const BMS_BUFMEM* bufmem
);
SCIP_EXPORT
void BMSprintBufferMemory(
BMS_BUFMEM* buffer
);
#ifdef __cplusplus
}
#endif
#endif