| 231 | } |
| 232 | |
| 233 | static void |
| 234 | _vm_object_allocate(objtype_t type, vm_pindex_t size, u_short flags, |
| 235 | vm_object_t object, void *handle) |
| 236 | { |
| 237 | |
| 238 | TAILQ_INIT(&object->memq); |
| 239 | LIST_INIT(&object->shadow_head); |
| 240 | |
| 241 | object->type = type; |
| 242 | if (type == OBJT_SWAP) |
| 243 | pctrie_init(&object->un_pager.swp.swp_blks); |
| 244 | |
| 245 | /* |
| 246 | * Ensure that swap_pager_swapoff() iteration over object_list |
| 247 | * sees up to date type and pctrie head if it observed |
| 248 | * non-dead object. |
| 249 | */ |
| 250 | atomic_thread_fence_rel(); |
| 251 | |
| 252 | object->pg_color = 0; |
| 253 | object->flags = flags; |
| 254 | object->size = size; |
| 255 | object->domain.dr_policy = NULL; |
| 256 | object->generation = 1; |
| 257 | object->cleangeneration = 1; |
| 258 | refcount_init(&object->ref_count, 1); |
| 259 | object->memattr = VM_MEMATTR_DEFAULT; |
| 260 | object->cred = NULL; |
| 261 | object->charge = 0; |
| 262 | object->handle = handle; |
| 263 | object->backing_object = NULL; |
| 264 | object->backing_object_offset = (vm_ooffset_t) 0; |
| 265 | #if VM_NRESERVLEVEL > 0 |
| 266 | LIST_INIT(&object->rvq); |
| 267 | #endif |
| 268 | umtx_shm_object_init(object); |
| 269 | } |
| 270 | |
| 271 | /* |
| 272 | * vm_object_init: |
no test coverage detected