MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _vm_object_allocate

Function _vm_object_allocate

freebsd/vm/vm_object.c:233–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233static 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:

Callers 3

vm_object_initFunction · 0.85
vm_object_allocateFunction · 0.85
vm_object_allocate_anonFunction · 0.85

Calls 4

pctrie_initFunction · 0.85
refcount_initFunction · 0.85
umtx_shm_object_initFunction · 0.85
atomic_thread_fence_relFunction · 0.50

Tested by

no test coverage detected