#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "omConfig.h"
#include "omDerivedConfig.h"
#include "omStructs.h"
#include "omAllocPrivate.h"
Go to the source code of this file.
◆ _POSIX_SOURCE
◆ INCR_FACTOR
◆ MH_TABLES_C
◆ MIN_BIN_BLOCKS
◆ OM_MAX_BLOCK_SIZE
◆ CreateDenseBins()
Definition at line 136 of file omTables.c.
138 size_t size, align_size = SIZEOF_OM_ALIGNMENT;
140 #ifdef OM_ALIGNMENT_NEEDS_WORK
150 #ifdef OM_ALIGNMENT_NEEDS_WORK
151 if (
size >= n && align_size != SIZEOF_STRICT_ALIGNMENT)
153 align_size = SIZEOF_STRICT_ALIGNMENT;
◆ GetMaxBlockThreshold()
int GetMaxBlockThreshold |
( |
| ) |
|
Definition at line 123 of file omTables.c.
132 printf(
"error");fflush(stdout);
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 165 of file omTables.c.
167 int max_bin_index = 0;
169 #ifdef OM_HAVE_DENSE_BIN_DISTRIBUTION
181 "#ifndef OM_TABLES_H\n"
182 "#define OM_TABLES_H\n"
183 "#define OM_MAX_BLOCK_SIZE %d\n"
184 "#define OM_MAX_BIN_INDEX %d\n"
185 "#define OM_SIZEOF_UNIQUE_MAX_BLOCK_THRESHOLD %d\n"
186 "#endif /* OM_TABLES_H */\n"
192 "#ifndef OM_TABLES_INC\n"
193 "#define OM_TABLES_INC\n"
201 #ifdef OM_ALIGNMENT_NEEDS_WORK
205 printf(
"\n#ifdef OM_HAVE_TRACK\n");
209 #ifdef OM_ALIGNMENT_NEEDS_WORK
214 printf(
"\n#endif /* OM_HAVE_TRACK */\n");
216 printf(
"\n#endif /* OM_TABLES_INC */\n");
◆ OutputSize2AlignedBin()
void OutputSize2AlignedBin |
( |
size_t * |
binSize, |
|
|
size_t |
max_block_size, |
|
|
int |
track |
|
) |
| |
Definition at line 81 of file omTables.c.
86 fprintf(stderr,
"OM_MAX_BLOCK_SIZE == %d not divisible by 8\n",
OM_MAX_BLOCK_SIZE);fflush(stdout);
89 printf(
"omBin om_Size2%sBin[/*%ld*/] = {\n",
90 (track ?
"Track" :
"Aligned"), (
long)(max_block_size / SIZEOF_OM_ALIGNMENT));
92 while (binSize[
i] % SIZEOF_STRICT_ALIGNMENT != 0)
i++;
93 j=SIZEOF_OM_ALIGNMENT;
94 while (
j < max_block_size)
96 printf(
"&om_Static%sBin[%ld], /* %ld */ \n", (track ?
"Track" :
""),
i,
j);
100 while (binSize[
i] % SIZEOF_STRICT_ALIGNMENT != 0)
i++;
102 j += SIZEOF_OM_ALIGNMENT;
104 printf(
"&om_Static%sBin[%ld] /* %ld */};\n\n", (track ?
"Track" :
""),
i,
j);
◆ OutputSize2Bin()
void OutputSize2Bin |
( |
size_t * |
binSize, |
|
|
size_t |
max_block_size, |
|
|
int |
track |
|
) |
| |
Definition at line 65 of file omTables.c.
68 printf(
"omBin om_Size2%sBin[/*%ld*/] = {\n",
69 (track?
"Track" :
""), (
long)(max_block_size / SIZEOF_OM_ALIGNMENT));
71 j=SIZEOF_OM_ALIGNMENT;
72 while (
j < max_block_size)
74 printf(
"&om_Static%sBin[%ld], /* %ld */ \n", (track?
"Track" :
""),
i,
j);
75 if (binSize[
i] ==
j)
i++;
76 j += SIZEOF_OM_ALIGNMENT;
78 printf(
"&om_Static%sBin[%ld] /* %ld */};\n\n", (track?
"Track" :
""),
i,
j);
◆ OutputStaticBin()
void OutputStaticBin |
( |
size_t * |
binSize, |
|
|
int |
max_bin_index, |
|
|
int |
track |
|
) |
| |
Definition at line 107 of file omTables.c.
110 printf(
"omBin_t om_Static%sBin[/*%d*/] = {\n", (track ?
"Track" :
""), max_bin_index+1);
112 for (
i=0;
i< max_bin_index;
i++)
114 printf(
"{om_ZeroPage, NULL, NULL, %ld, %ld, 0},\n",
115 (
long)(binSize[
i] / SIZEOF_LONG),
118 printf(
"{om_ZeroPage, NULL, NULL, %ld, %ld, 0}\n};\n\n",
119 (
long)(binSize[
i] / SIZEOF_LONG),
◆ om_BinSize
Initial value:=
{ 8, 12, 16, 20,
24, 28, 32,
40, 48, 56, 64,
80, 96, 112, 128,
160, 192, 224,
Definition at line 50 of file omTables.c.