https://github.com/Singular/Sources
Tip revision: 35c6e2c47bae1f858ec6f4a0cdab911b80a1c383 authored by Hans Schoenemann on 22 January 2021, 14:55:14 UTC
fix: map Z, Zn ->Zp, mpz_z ->Zp
fix: map Z, Zn ->Zp, mpz_z ->Zp
Tip revision: 35c6e2c
omAllocSystem.h
/*******************************************************************
* File: omAllocSystem.h
* Purpose: declaration of routines for low-level alloc routines
* and page management
* Author: obachman (Olaf Bachmann)
* Created: 11/99
*******************************************************************/
#ifndef OM_ALLOC_SYSTEM_H
#define OM_ALLOC_SYSTEM_H
#ifndef _OMALLOC_OMCONFIG_H
#include "omalloc/omConfig.h"
#endif
size_t omSizeOfAddr(const void* addr);
size_t omSizeWOfAddr(void* addr);
size_t omSizeOfLargeAddr(void* addr);
#define omSizeWOfLargeAddr(addr) (omSizeOfLargeAddr(addr) >> LOG_SIZEOF_LONG)
void* omAllocFromSystem(size_t size);
void* omReallocFromSystem(void* addr, size_t newsize);
void omFreeToSystem(void* addr);
void* omReallocSizeFromSystem(void* addr, size_t oldsize, size_t newsize);
void omFreeSizeToSystem(void* addr, size_t size);
#define omVallocFromSystem(size) _omVallocFromSystem(size, 0)
void* _omVallocFromSystem(size_t size, int fail);
void omVfreeToSystem(void* page, size_t size);
#if defined(HAVE_MALLOC_SIZE) || defined(HAVE_MALLOC_USABLE_SIZE)
#define omAllocLarge(size) omAllocFromSystem(size)
#define omReallocLarge(addr, new_size) omReallocSizeFromSystem(addr, omSizeOfLargeAddr(addr), new_size)
#define omFreeLarge(addr) omFreeSizeToSystem(addr, omSizeOfLargeAddr(addr))
#else
void* omAllocLarge(size_t size);
void* omReallocLarge(void* old_addr, size_t new_size);
void omFreeLarge(void* addr);
#endif
void* omRealloc0Large(void* old_addr, size_t new_size);
void* omAlloc0Large(size_t size);
#endif /* OM_ALLOC_SYSTEM_H */