9 /* This configuration will test mostly inserting of elements that are already inserted since
10 the number of repeats is 200 */
13 #define ELEMENTS_PER_MAP 100
14 #define NUM_REPEATS 200
16 #define KEY_TYPE_FIXED_SIZE 8
17 void *key_buffer
= malloc (17);
18 typedef char * name_string
;
19 name_string fake_names
[NUM_MAPS
];
21 /* This variable has to be put in rel.ro */
22 void * maps
[NUM_MAPS
] VTV_PROTECTED_VAR
;
27 void * fake_vts
[NUM_MAPS
* ELEMENTS_PER_MAP
];
34 for (i
= 0; i
< NUM_MAPS
; ++i
)
36 fake_names
[i
] = (char *) malloc (9 * sizeof (char));
37 snprintf (fake_names
[i
], 9, "name%d", i
);
42 vtv_string_hash(const char *in
)
54 __VLTChangePermission(__VLTP_READ_WRITE
);
58 for (int k
= 0; k
< NUM_REPEATS
; k
++)
61 for (int i
= 0; i
< NUM_MAPS
; i
++)
63 uint32_t *value_ptr
= (uint32_t *) key_buffer
;
64 uint32_t len1
= strlen (fake_names
[i
]);
65 uint32_t hash_value
= vtv_string_hash (fake_names
[i
]);
66 void *temp_array
[ELEMENTS_PER_MAP
];
70 *value_ptr
= hash_value
;
72 memcpy ((char *) key_buffer
+ KEY_TYPE_FIXED_SIZE
, fake_names
[i
],
77 __VLTRegisterPairDebug (&maps
[i
], (char *) key_buffer
, 128,
78 &fake_vts
[curr_fake_vt
], "", "");
80 __VLTRegisterPair (&maps
[i
], (char *) key_buffer
, 128,
81 &fake_vts
[curr_fake_vt
]);
83 for (int j
= 0; j
< ELEMENTS_PER_MAP
; j
++)
85 temp_array
[j
] = &fake_vts
[curr_fake_vt
];
89 __VLTRegisterSetDebug (&maps
[i
], (char *) key_buffer
, 128, 100,
90 (void **) &temp_array
);
92 __VLTRegisterSet (&maps
[i
], (char *) key_buffer
, 128, 100,
93 (void **) &temp_array
);
98 __VLTChangePermission(__VLTP_READ_ONLY
);