-void vm_map_store_copy_insert_rb( vm_map_t map, __unused vm_map_entry_t after_where, vm_map_copy_t copy)
-{
- struct vm_map_header *mapHdr = &(map->hdr);
- struct rb_head *rbh = &(mapHdr->rb_head_store);
- struct vm_map_store *store;
- vm_map_entry_t entry = vm_map_copy_first_entry(copy);
- int inserted=0, nentries = copy->cpy_hdr.nentries;
-
- while (entry != vm_map_copy_to_entry(copy) && nentries > 0) {
- vm_map_entry_t prev = entry;
- store = &(entry->store);
- if( RB_INSERT( rb_head, rbh, store ) != NULL){
- panic("VMSCIR1: INSERT FAILED: %d: %p, %p, %p, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx",inserted, prev, entry, vm_map_copy_to_entry(copy),
- (uintptr_t)prev->vme_start, (uintptr_t)prev->vme_end, (uintptr_t)entry->vme_start, (uintptr_t)entry->vme_end,
- (uintptr_t)(VME_FOR_STORE(rbh->rbh_root))->vme_start, (uintptr_t)(VME_FOR_STORE(rbh->rbh_root))->vme_end);
- } else {
-#if MAP_ENTRY_INSERTION_DEBUG
- fastbacktrace(&entry->vme_insertion_bt[0],
- (sizeof (entry->vme_insertion_bt) / sizeof (uintptr_t)));
-#endif
- entry = entry->vme_next;
- inserted++;
- nentries--;
- }