Ejemplo n.º 1
0
int 
locality_profile_init()
{
	int i;

	locality_profile.context_hash_map
		=  new_hash_map();
	locality_profile.s2t_map = (struct size2mtype_entry *)
		internal_calloc(RESTRICT_MAPPING, S2T_MAP_SIZE + 1, 
			sizeof(struct size2mtype_entry));
	for (i = 0; i < S2T_MAP_SIZE + 1; i++) {
		utl_spinlock_init(&locality_profile.s2t_map[i].lock,
		                  UTL_PROCESS_SHARED);
	}	

	locality_profile.context_idx = 1;
	locality_profile.chunk_idx = 0;

	return 0;
}
Ejemplo n.º 2
0
TEST_F(MallocTests, SimpleCalloc) {
  void *ptr = NULL;
  ptr = internal_calloc(1, 16);
  ASSERT_NE(ptr, (void *) NULL);
}