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

Function vm_object_allocate_anon

freebsd/vm/vm_object.c:455–473  ·  view source on GitHub ↗

* vm_object_allocate_anon: * * Returns a new default object of the given size and marked as * anonymous memory for special split/collapse handling. Color * to be initialized by the caller. */

Source from the content-addressed store, hash-verified

453 * to be initialized by the caller.
454 */
455vm_object_t
456vm_object_allocate_anon(vm_pindex_t size, vm_object_t backing_object,
457 struct ucred *cred, vm_size_t charge)
458{
459 vm_object_t handle, object;
460
461 if (backing_object == NULL)
462 handle = NULL;
463 else if ((backing_object->flags & OBJ_ANON) != 0)
464 handle = backing_object->handle;
465 else
466 handle = backing_object;
467 object = uma_zalloc(obj_zone, M_WAITOK);
468 _vm_object_allocate(OBJT_DEFAULT, size, OBJ_ANON | OBJ_ONEMAPPING,
469 object, handle);
470 object->cred = cred;
471 object->charge = cred != NULL ? charge : 0;
472 return (object);
473}
474
475static void
476vm_object_reference_vnode(vm_object_t object)

Callers 5

vm_map_entry_backFunction · 0.85
vm_map_lookupFunction · 0.85
vm_object_shadowFunction · 0.85
vm_object_splitFunction · 0.85
vm_fault_copy_entryFunction · 0.85

Calls 2

_vm_object_allocateFunction · 0.85
uma_zallocFunction · 0.70

Tested by

no test coverage detected