source: git/omalloc/omAllocSystem.h @ 9cf75aa

spielwiese
Last change on this file since 9cf75aa was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 1.5 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
11size_t omSizeOfAddr(const void* addr);
12size_t omSizeWOfAddr(void* addr);
13
14size_t omSizeOfLargeAddr(void* addr);
15#define omSizeWOfLargeAddr(addr) (omSizeOfLargeAddr(addr) >> LOG_SIZEOF_LONG)
16
17void* omAllocFromSystem(size_t size);
18void* omReallocFromSystem(void* addr, size_t newsize);
19void  omFreeToSystem(void* addr);
20
21void* omReallocSizeFromSystem(void* addr, size_t oldsize, size_t newsize);
22void  omFreeSizeToSystem(void* addr, size_t size);
23
24#define omVallocFromSystem(size) _omVallocFromSystem(size, 0)
25void* _omVallocFromSystem(size_t size, int fail);
26void omVfreeToSystem(void* page, size_t size);
27
28
29#ifdef OM_MALLOC_PROVIDES_SIZEOF_ADDR
30#define omAllocLarge(size)             omAllocFromSystem(OM_ALIGN_SIZE(size))
31#define omReallocLarge(addr, new_size) omReallocSizeFromSystem(addr, omSizeOfLargeAddr(addr), OM_ALIGN_SIZE(new_size))
32#define omFreeLarge(addr)              omFreeSizeToSystem(addr, omSizeOfLargeAddr(addr))
33#else
34void* omAllocLarge(size_t size);
35void* omReallocLarge(void* old_addr, size_t new_size);
36void  omFreeLarge(void* addr);
37#endif
38void* omRealloc0Large(void* old_addr, size_t new_size);
39void* omAlloc0Large(size_t size);
40
41#endif /* OM_ALLOC_SYSTEM_H */
Note: See TracBrowser for help on using the repository browser.