diff vmalloc.h @ 139:99798e4438a6

Merge of Malloc2 and inter master requests
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 19 Sep 2011 16:12:01 +0200
parents 9b2b9bc2c362 0b49fd35afc1
children 98fc8f3761a2
line diff
     1.1 --- a/vmalloc.h	Wed Sep 07 19:36:46 2011 +0200
     1.2 +++ b/vmalloc.h	Mon Sep 19 16:12:01 2011 +0200
     1.3 @@ -6,13 +6,13 @@
     1.4   *
     1.5   * Created on November 14, 2009, 9:07 PM
     1.6   */
     1.7 -
     1.8  #ifndef _VMALLOC_H
     1.9  #define	_VMALLOC_H
    1.10  
    1.11  #include <malloc.h>
    1.12  #include <inttypes.h>
    1.13  #include "VMS_primitive_data_types.h"
    1.14 +#include "ProcrContext.h"
    1.15  
    1.16  #define SMALL_CHUNK_SIZE 32
    1.17  #define SMALL_CHUNK_COUNT 4
    1.18 @@ -30,12 +30,12 @@
    1.19     MallocProlog *prevChunkInFreeList;
    1.20     MallocProlog *nextHigherInMem;
    1.21     MallocProlog *nextLowerInMem;
    1.22 - };
    1.23 + }; 
    1.24  //MallocProlog
    1.25   
    1.26   typedef struct MallocArrays MallocArrays;
    1.27  
    1.28 - struct MallocArrays
    1.29 + struct MallocArrays 
    1.30   {
    1.31       MallocProlog **smallChunks;
    1.32       MallocProlog **bigChunks;
    1.33 @@ -43,24 +43,42 @@
    1.34       void         *memSpace;
    1.35       uint32       containerCount;
    1.36   };
    1.37 - //MallocArrays
    1.38 + //MallocArray
    1.39 +
    1.40 +
    1.41 + typedef struct
    1.42 +{
    1.43 +     uintptr_t procrID;
    1.44 +     MallocProlog *prevChunkInFreeList;
    1.45 +     MallocProlog *nextHigherInMem;
    1.46 +     MallocProlog *nextLowerInMem;
    1.47 + } MallocPrologAllocated;
    1.48 +
    1.49  
    1.50  typedef struct
    1.51   {
    1.52     MallocProlog *firstChunkInFreeList;
    1.53     int32         numInList; //TODO not used
    1.54 - }
    1.55 -FreeListHead;
    1.56 + } FreeListHead;
    1.57  
    1.58  void *
    1.59 -VMS__malloc( size_t sizeRequested );
    1.60 +VMS__malloc_on_core(size_t sizeRequested, int procrID);
    1.61  
    1.62  void *
    1.63 -VMS__malloc_aligned( size_t sizeRequested );
    1.64 +VMS__malloc(size_t sizeRequested);
    1.65 +
    1.66 +void *
    1.67 +VMS__malloc_in_lib(size_t sizeRequested, VirtProcr *VProc);
    1.68  
    1.69  void
    1.70  VMS__free( void *ptrToFree );
    1.71  
    1.72 +void
    1.73 +VMS__free_in_lib(void *ptrToFree, VirtProcr *VProc);
    1.74 +
    1.75 +void
    1.76 +VMS__free_on_core(void *ptrToFree, int procrID);
    1.77 +
    1.78  /*Allocates memory from the external system -- higher overhead
    1.79   */
    1.80  void *
    1.81 @@ -71,7 +89,6 @@
    1.82  void
    1.83  VMS__free_in_ext( void *ptrToFree );
    1.84  
    1.85 -
    1.86  MallocArrays *
    1.87  VMS_ext__create_free_list();
    1.88