Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
view vmalloc.h @ 205:cb888346c3e0
Changed include paths, but version still does not work because of accidental merge
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Fri, 17 Feb 2012 18:28:59 +0100 |
| parents | c1784868dcea |
| children |
line source
1 /*
2 * Copyright 2009 OpenSourceCodeStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 * Created on November 14, 2009, 9:07 PM
8 */
10 #ifndef _VMALLOC_H
11 #define _VMALLOC_H
13 #include <malloc.h>
14 #include <inttypes.h>
15 #include "VMS_primitive_data_types.h"
17 typedef struct _MallocProlog MallocProlog;
19 struct _MallocProlog
20 {
21 MallocProlog *nextChunkInFreeList;
22 MallocProlog *prevChunkInFreeList;
23 MallocProlog *nextHigherInMem;
24 MallocProlog *nextLowerInMem;
25 };
26 //MallocProlog
28 typedef struct
29 {
30 MallocProlog *firstChunkInFreeList;
31 int32 numInList; //TODO not used
32 }
33 FreeListHead;
35 void *
36 VMS_int__malloc( size_t sizeRequested );
38 void *
39 VMS_int__malloc_aligned( size_t sizeRequested );
41 void
42 VMS_int__free( void *ptrToFree );
44 #define VMS_PI__malloc VMS_int__malloc
45 #define VMS_PI__malloc_aligned VMS_int__malloc_aligned
46 #define VMS_PI__free VMS_int__free
47 /* For now, the PI is protected by master lock, so int malloc fine
48 void *
49 VMS_PI__malloc( size_t sizeRequested );
51 void *
52 VMS_PI__malloc_aligned( size_t sizeRequested );
54 void
55 VMS_PI__free( void *ptrToFree );
56 */
58 //TODO: protect WL malloc from concurrency!! shared freelist can be corrupted
59 #define VMS_WL__malloc VMS_int__malloc
60 #define VMS_WL__malloc_aligned VMS_int__malloc_aligned
61 #define VMS_WL__free VMS_int__free
62 /*
63 void *
64 VMS_WL__malloc( size_t sizeRequested );
66 void *
67 VMS_WL__malloc_aligned( size_t sizeRequested );
69 void
70 VMS_WL__free( void *ptrToFree );
71 */
73 /*Allocates memory from the external system -- higher overhead
74 */
75 void *
76 VMS__malloc_in_ext( size_t sizeRequested );
78 /*Frees memory that was allocated in the external system -- higher overhead
79 */
80 void
81 VMS__free_in_ext( void *ptrToFree );
84 MallocProlog *
85 VMS_ext__create_free_list();
87 void
88 VMS_ext__free_free_list( MallocProlog *freeListHead );
90 #endif
