diff vmalloc.h @ 132:dbfc8382d546

distributed memory allocation interface - unfinished
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 16 Sep 2011 14:25:49 +0200
parents 521c75d64cef
children a9b72021f053
line diff
     1.1 --- a/vmalloc.h	Wed Sep 07 17:45:05 2011 +0200
     1.2 +++ b/vmalloc.h	Fri Sep 16 14:25:49 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  typedef struct _MallocProlog MallocProlog;
    1.17  
    1.18 @@ -22,25 +22,41 @@
    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
    1.27 + {
    1.28 +     uintptr_t procrID;
    1.29 +     MallocProlog *prevChunkInFreeList;
    1.30 +     MallocProlog *nextHigherInMem;
    1.31 +     MallocProlog *nextLowerInMem;
    1.32 + } MallocPrologAllocated;
    1.33  
    1.34  typedef struct
    1.35   {
    1.36     MallocProlog *firstChunkInFreeList;
    1.37     int32         numInList; //TODO not used
    1.38 - }
    1.39 -FreeListHead;
    1.40 + } FreeListHead;
    1.41  
    1.42  void *
    1.43 -VMS__malloc( size_t sizeRequested );
    1.44 +VMS__malloc_on_core(size_t sizeRequested, int procrID);
    1.45  
    1.46  void *
    1.47 -VMS__malloc_aligned( size_t sizeRequested );
    1.48 +VMS__malloc(size_t sizeRequested);
    1.49 +
    1.50 +void *
    1.51 +VMS__malloc_in_lib(size_t sizeRequested, VirtProcr *VProc);
    1.52  
    1.53  void
    1.54  VMS__free( void *ptrToFree );
    1.55  
    1.56 +void
    1.57 +VMS__free_in_lib(void *ptrToFree, VirtProcr *VProc);
    1.58 +
    1.59 +void
    1.60 +VMS__free_on_core(void *ptrToFree, int procrID);
    1.61 +
    1.62  /*Allocates memory from the external system -- higher overhead
    1.63   */
    1.64  void *