/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/Map.c

  • Committer: Gustav Hartvigsson
  • Date: 2016-01-25 21:52:28 UTC
  • mto: This revision was merged to the branch mainline in revision 111.
  • Revision ID: gustav.hartvigsson@gmail.com-20160125215228-m9k1we2mplfla6y4
* Getting closer to fixing the callbacks...

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
   */
95
95
  self->free_key = free_key;
96
96
  self->free_value = free_value;
97
 
 
 
97
  
 
98
  /*
 
99
   * Creating a place to store the items.
 
100
   */
 
101
  self->array = s_dynamic_array_new (S_MAP_DEFAULT_NUMBER_OF_BUCKETS,
 
102
                                     FREEFUNC (s_map_item_free));
 
103
  
98
104
  /* if no func is set we have to use some other metod of
99
105
   */
100
106
  if (key_hash_func == NULL){
103
109
    self->key_hash_func = key_hash_func;
104
110
  }
105
111
 
106
 
  self->array = s_dynamic_array_new (S_MAP_DEFAULT_NUMBER_OF_BUCKETS,
107
 
                                     FREEFUNC(_internal_s_map_free_buckets));
108
 
 
109
112
  return self;
110
113
}
111
114
 
112
115
void
113
116
s_map_free (SMap * self, sboolean free_data) {
114
 
 
 
117
  
115
118
  s_map_for_each (self,
116
119
                  FOREACHFUNC(_s_map_internal_free_map_items_for_each),
117
 
                  &free_data);
 
120
                  free_data);
118
121
 
119
 
  s_dynamic_array_free (self->array, TRUE);
 
122
  s_dynamic_array_free (self->array, FALSE);
120
123
  free (self);
121
124
}
122
125
 
254
257
  }
255
258
}
256
259
 
257
 
void
258
 
_internal_s_map_free_buckets (SLinkedList * self) {
259
 
  s_dbg_print ("Freeing bucket.");
260
 
  s_linked_list_free (self, FALSE);
261
 
}