/*****************************************************************************/ /* Vm.h */ /*****************************************************************************/ #ifndef VM_H_LOADED #define VM_H_LOADED 1 #include "wasd.h" /**********/ /* macros */ /**********/ #define VM_MAGIC1 0xDEADC0DE /* general */ #define VM_MAGIC2 0xBADDCAFE /* request */ #define VM_MAGIC3 0xB16B00B5 /* HTTP/2 */ #define VM_H2MAGIC 0xDDEFACED /* HTTP/2 header space */ /**************/ /* structures */ /**************/ #pragma member_alignment __save #pragma nomember_alignment typedef struct VmStruct VM_STRUCT; /* 24 bytes overhead in total */ struct VmStruct { ulong size, magic; /* fill to quadword */ uchar fill [7]; /* inbuilt HTTP/2 header fields (also see HTTP2.H) */ union vm_header2 { uchar h2header [9]; struct { uchar h2length [3]; uchar h2type [1]; uchar h2flags [1]; uchar h2ident [4]; }; struct { /* filler to header size */ uchar h2fill [5]; ulong h2magic; }; }; uchar h2payload []; }; #pragma member_alignment __restore /***********************/ /* function prototypes */ /***********************/ /* general memory */ VmGeneralInit (); uchar* VmGet (ulong); VmFree (uchar*, char*, int); uchar* VmRealloc (uchar*, ulong, char*, int); /* HTTP/2 memory */ VmHttp2Init (); VmHttp2Tune (); HTTP2_STRUCT* VmHttp2Get (); VmHttp2Free (HTTP2_STRUCT*, char*, int); VmFree2Heap (HTTP2_STRUCT*, char*, int); VmFreeFrom2Heap (HTTP2_STRUCT*, uchar*, char*, int); uchar* VmRealloc2Heap (HTTP2_STRUCT*, uchar*, ulong, char*, int); /* request memory */ VmRequestInit (); VmRequestTune (); REQUEST_STRUCT* VmGetRequest (); VmFreeRequest (REQUEST_STRUCT*, char*, int); uchar* VmGetHeap (REQUEST_STRUCT*, ulong); VmFreeHeap (REQUEST_STRUCT*, char*, int); VmFreeFromHeap (REQUEST_STRUCT*, uchar*, char*, int); uchar* VmReallocHeap (REQUEST_STRUCT*, uchar*, ulong, char*, int); /* cache memory */ VmCacheInit (int); uchar* VmGetCache (ulong); VmFreeCache (uchar*, char*, int); VmPermCacheInit (int); uchar* VmGetPermCache (ulong); VmFreePermCache (uchar*, char*, int); /* memory report */ VmReport (REQUEST_STRUCT*, REQUEST_AST); VmWrite (struct dsc$descriptor*, REQUEST_STRUCT*); #endif /* VM_H_LOADED */ /*****************************************************************************/