"Fossies" - the Fresh Open Source Software Archive

Member "hashcat-6.2.6/deps/LZMA-SDK/C/Alloc.h" (2 Sep 2022, 1083 Bytes) of package /linux/privat/hashcat-6.2.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Alloc.h": 6.2.1_vs_6.2.2.

    1 /* Alloc.h -- Memory allocation functions
    2 2021-02-08 : Igor Pavlov : Public domain */
    3 
    4 #ifndef __COMMON_ALLOC_H
    5 #define __COMMON_ALLOC_H
    6 
    7 #include "7zTypes.h"
    8 
    9 EXTERN_C_BEGIN
   10 
   11 void *MyAlloc(size_t size);
   12 void MyFree(void *address);
   13 
   14 #ifdef _WIN32
   15 
   16 void SetLargePageSize(void);
   17 
   18 void *MidAlloc(size_t size);
   19 void MidFree(void *address);
   20 void *BigAlloc(size_t size);
   21 void BigFree(void *address);
   22 
   23 #else
   24 
   25 #define MidAlloc(size) MyAlloc(size)
   26 #define MidFree(address) MyFree(address)
   27 #define BigAlloc(size) MyAlloc(size)
   28 #define BigFree(address) MyFree(address)
   29 
   30 #endif
   31 
   32 extern const ISzAlloc g_Alloc;
   33 extern const ISzAlloc g_BigAlloc;
   34 extern const ISzAlloc g_MidAlloc;
   35 extern const ISzAlloc g_AlignedAlloc;
   36 
   37 
   38 typedef struct
   39 {
   40   ISzAlloc vt;
   41   ISzAllocPtr baseAlloc;
   42   unsigned numAlignBits; /* ((1 << numAlignBits) >= sizeof(void *)) */
   43   size_t offset;         /* (offset == (k * sizeof(void *)) && offset < (1 << numAlignBits) */
   44 } CAlignOffsetAlloc;
   45 
   46 void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p);
   47 
   48 
   49 EXTERN_C_END
   50 
   51 #endif