My Project
Loading...
Searching...
No Matches
Macros | Functions | Variables
omTables1.c File Reference
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "omalloc/omConfig.h"
#include "omalloc/omDerivedConfig.h"
#include "omalloc/omStructs.h"
#include "omalloc/omAllocPrivate.h"

Go to the source code of this file.

Macros

#define MH_TABLES_C
 
#define _POSIX_SOURCE   1
 
#define MIN_BIN_BLOCKS   4
 
#define INCR_FACTOR   1
 
#define OM_MAX_BLOCK_SIZE   ((SIZEOF_OM_BIN_PAGE / MIN_BIN_BLOCKS) & ~(SIZEOF_STRICT_ALIGNMENT - 1))
 

Functions

int GetMaxBlockThreshold ()
 
void CreateDenseBins ()
 
int main (int argc, char *argv[])
 

Variables

size_t om_BinSize [SIZEOF_OM_BIN_PAGE/MIN_BIN_BLOCKS]
 

Macro Definition Documentation

◆ _POSIX_SOURCE

#define _POSIX_SOURCE   1

Definition at line 11 of file omTables1.c.

◆ INCR_FACTOR

#define INCR_FACTOR   1

Definition at line 27 of file omTables1.c.

◆ MH_TABLES_C

#define MH_TABLES_C

Definition at line 9 of file omTables1.c.

◆ MIN_BIN_BLOCKS

#define MIN_BIN_BLOCKS   4

Definition at line 26 of file omTables1.c.

◆ OM_MAX_BLOCK_SIZE

#define OM_MAX_BLOCK_SIZE   ((SIZEOF_OM_BIN_PAGE / MIN_BIN_BLOCKS) & ~(SIZEOF_STRICT_ALIGNMENT - 1))

Definition at line 31 of file omTables1.c.

Function Documentation

◆ CreateDenseBins()

void CreateDenseBins ( )

Definition at line 78 of file omTables1.c.

79{
81 int i = 1;
82#ifdef OM_ALIGNMENT_NEEDS_WORK
83 int n = GetMaxBlockThreshold();
84#endif
85
88 i = 1;
89 while (size < OM_MAX_BLOCK_SIZE)
90 {
92#ifdef OM_ALIGNMENT_NEEDS_WORK
94 {
97 }
98#endif
99 om_BinSize[i] = size;
101 {
102 i++;
103 }
104 }
105}
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
int i
Definition cfEzgcd.cc:132
#define SIZEOF_OM_BIN_PAGE
int GetMaxBlockThreshold()
Definition omTables1.c:65
size_t om_BinSize[SIZEOF_OM_BIN_PAGE/MIN_BIN_BLOCKS]
Definition omTables1.c:50
#define OM_MAX_BLOCK_SIZE
Definition omTables1.c:31

◆ GetMaxBlockThreshold()

int GetMaxBlockThreshold ( )

Definition at line 65 of file omTables1.c.

66{
67 int i;
69 {
71 return i;
72 }
73 /* should never get here */
74 printf("error");fflush(stdout);
75 _exit(1);
76}

◆ main()

int main ( int  argc,
char argv[] 
)

Definition at line 107 of file omTables1.c.

108{
109 int max_bin_index = 0;
110 /* determine max_bin_index */
111#ifdef OM_HAVE_DENSE_BIN_DISTRIBUTION
113#endif
114 for(;;)
115 {
118 }
119 {
120 /* output what goes into omTables.h */
121 printf(
122"#ifndef OM_TABLES_H\n"
123"#define OM_TABLES_H\n"
124"#define OM_MAX_BLOCK_SIZE %d\n"
125"#define OM_MAX_BIN_INDEX %d\n"
126"#define OM_SIZEOF_UNIQUE_MAX_BLOCK_THRESHOLD %d\n"
127"#endif /* OM_TABLES_H */\n"
129 return 0;
130 }
131}
void CreateDenseBins()
Definition omTables1.c:78

Variable Documentation

◆ om_BinSize