view vmalloc.h @ 200:6db9e4898978

VMS name chgs -- added "WL" "PI" and "int" and split vms.h up
author Me@portablequad
date Sun, 12 Feb 2012 01:49:33 -0800
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