- /* if we have reached our current mapping limit, expand it */
- if (mmap_infos_cur == mmap_infos_max) {
- struct mmap_info *realloc_mmap_infos = NULL;
-
- mmap_infos_max += NEW_MMAP_STRUCT_CNT;
- realloc_mmap_infos = (struct mmap_info *) realloc(mmap_infos,
- mmap_infos_max * sizeof(struct mmap_info));
- if (realloc_mmap_infos == NULL) {
- mmap_infos_max -= NEW_MMAP_STRUCT_CNT;
- goto error_mutex_unlock;
- }
- mmap_infos = realloc_mmap_infos;
+ /* Add the new mapping to the hashtable. */
+ if (!g_hash_table_insert(mmap_mappings, mapping_addr, mapping)) {
+ BT_LOGF_STR("Failed to insert mapping in the hashtable.");
+ abort();