template <size_t num_objects>

struct PageObject

Defined at line 341 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

The PageObject represents a memory page which holds at most |num_objects|

of TrackedType, along with the control structures and the access spinlock.

In the code below we use the following terms:

- index : points to an entry on the array of TrackedTypes.

- id or ids : a full object tracker id or ids, the bottom part is an index

and the top part is a page id.

- smap: a sorted map, which maps ids to ids that belong to this page.

for example ids[0] might not belong to this page but ids[smap[0]] does.

Public Members

WAVLTreeNodeState<PageObject<num_objects> *, NodeOptions::AllowClearUnsafe> wavl_node_state_
const uint32_t page_id_
::lockdep::LockDep<PageObject<num_objects>, SpinLock, 521, ::lockdep::internal::DefaultLockFlags<>::value> page_lock_
IntSet<num_objects> node_tracker_
uint8_t[sizeof(TrackedType) * num_objects] storage_

Public Methods

void PageObject<num_objects> (uint32_t page_id)

Defined at line 344 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

void ~PageObject<num_objects> ()

Note: this destructor is not called during destroy_all() only

during remove() so the tracker returns memory to the page-cache

which in turn might return it to the system.

Defined at line 356 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

uint32_t page_id ()

The page id is the WAVL key and it is never zero.

Defined at line 361 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

Lock<SpinLock> * lock ()

Defined at line 363 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

zx::result<HolderType> get_locked (uint32_t index, uint32_t user_tag)

Make a holder from a valid |index| that points to a tracked object.

Defined at line 366 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

zx_status_t get_locked (ktl::span<const uint32_t> indirect_map, ktl::span<const uint32_t> ids, ktl::span<HolderType> holders)

Batch get. Note that the input |ids| contain the page, which we must strip.

Defined at line 378 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

zx_status_t add_locked (ktl::span<TrackedType> objects, ktl::span<uint32_t> ids)

Batch-add. Stops at the first error.

Defined at line 413 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

zx::result<uint32_t> add_locked (TrackedType && object)

Defined at line 426 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

zx_status_t remove_locked (ktl::span<const uint32_t> indirect_map, ktl::span<const uint32_t> ids, ktl::span<TrackedType> objects)

Batch remove. Note |ids| contain the page, not just the index so we need

to strip it.

Defined at line 446 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

zx::result<RemoveResult> remove_locked (uint32_t index, uint32_t user_tag)

Defined at line 480 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

uint32_t destroy_all ()

Defined at line 494 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

uint32_t free_count_locking ()

Defined at line 508 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

uint32_t object_count_locking ()

Defined at line 513 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

TrackedType * object_at (size_t index)

Defined at line 515 of file ../../zircon/kernel/lib/fbl/include/fbl/object_tracker.h

Records