My Project
Loading...
Searching...
No Matches
omAllocSystem.h
Go to the documentation of this file.
1/*******************************************************************
2 * File: omAllocSystem.h
3 * Purpose: declaration of routines for low-level alloc routines
4 * and page management
5 * Author: obachman (Olaf Bachmann)
6 * Created: 11/99
7 *******************************************************************/
8#ifndef OM_ALLOC_SYSTEM_H
9#define OM_ALLOC_SYSTEM_H
10
11#ifndef _OMALLOC_OMCONFIG_H
12#include "omalloc/omConfig.h"
13#endif
14
15size_t omSizeOfAddr(const void* addr);
16size_t omSizeWOfAddr(void* addr);
17
18size_t omSizeOfLargeAddr(void* addr);
19#define omSizeWOfLargeAddr(addr) (omSizeOfLargeAddr(addr) >> LOG_SIZEOF_LONG)
20
21void* omAllocFromSystem(size_t size);
22void* omReallocFromSystem(void* addr, size_t newsize);
23void omFreeToSystem(void* addr);
24
25void* omReallocSizeFromSystem(void* addr, size_t oldsize, size_t newsize);
26void omFreeSizeToSystem(void* addr, size_t size);
27
28#define omVallocFromSystem(size) _omVallocFromSystem(size, 0)
29void* _omVallocFromSystem(size_t size, int fail);
30void omVfreeToSystem(void* page, size_t size);
31
32
33#if defined(HAVE_MALLOC_SIZE) || defined(HAVE_MALLOC_USABLE_SIZE)
34#define omAllocLarge(size) omAllocFromSystem(size)
35#define omReallocLarge(addr, new_size) omReallocSizeFromSystem(addr, omSizeOfLargeAddr(addr), new_size)
36#define omFreeLarge(addr) omFreeSizeToSystem(addr, omSizeOfLargeAddr(addr))
37#else
38void* omAllocLarge(size_t size);
39void* omReallocLarge(void* old_addr, size_t new_size);
40void omFreeLarge(void* addr);
41#endif
42void* omRealloc0Large(void* old_addr, size_t new_size);
43void* omAlloc0Large(size_t size);
44
45#endif /* OM_ALLOC_SYSTEM_H */
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
void * _omVallocFromSystem(size_t size, int fail)
void * omAllocFromSystem(size_t size)
void * omReallocFromSystem(void *addr, size_t newsize)
void omVfreeToSystem(void *page, size_t size)
size_t omSizeOfLargeAddr(void *addr)
void omFreeLarge(void *addr)
Definition: omAllocSystem.c:73
void * omRealloc0Large(void *old_addr, size_t new_size)
Definition: omAllocSystem.c:89
void omFreeSizeToSystem(void *addr, size_t size)
void * omReallocLarge(void *old_addr, size_t new_size)
Definition: omAllocSystem.c:57
size_t omSizeOfAddr(const void *addr)
void omFreeToSystem(void *addr)
void * omAllocLarge(size_t size)
Definition: omAllocSystem.c:48
void * omReallocSizeFromSystem(void *addr, size_t oldsize, size_t newsize)
void * omAlloc0Large(size_t size)
Definition: omAllocSystem.c:82
#define omSizeWOfAddr(P)
Definition: xalloc.h:223