source: git/omalloc/omAllocSystem.h @ b6647a7

fieker-DuValspielwiese
Last change on this file since b6647a7 was 5c8d860, checked in by Hans Schoenemann <hannes@…>, 7 years ago
force inclusion of omConfig in omAllocSystem.h
  • Property mode set to 100644
File size: 1.6 KB
Line 
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 */
Note: See TracBrowser for help on using the repository browser.