class HandleTableArena

Defined at line 80 of file ../../src/devices/bin/driver_runtime/handle.h

HandleTableArena provides the memory backing the Handle objects.

This class is thread-safe.

Public Members

static const size_t kMaxNumHandles
static const size_t kNumTables
static const size_t kHandlesPerTable

Public Methods

void HandleTableArena ()

Defined at line 89 of file ../../src/devices/bin/driver_runtime/handle.h

void ~HandleTableArena ()

Defined at line 91 of file ../../src/devices/bin/driver_runtime/handle.h

void Delete (Handle * handle)

Clears handle state specific to this lifetime and adds the handle to the free

list for re-use.

Defined at line 111 of file ../../src/devices/bin/driver_runtime/handle.h

Handle * Alloc (fbl::RefPtr<Object> object, fdf_handle_t * out_handle_value)

Alloc returns storage for a handle.

|out_handle_value| is the generated handle value referring to the returned Handle object.

Defined at line 140 of file ../../src/devices/bin/driver_runtime/handle.cc

fbl::RefPtr<Object> GetObject (fdf_handle_t handle_value)

Returns the object corresponding to |handle_value|.

Returns nullptr if the handle is invalid or has no object.

Defined at line 176 of file ../../src/devices/bin/driver_runtime/handle.cc

std::pair<HandleOwner, fbl::RefPtr<Object>> TakeOwnership (fdf_handle_t handle_value)

Takes ownership of the handle, resetting its object and returning the HandleOwner and the

object. Returns nullptr HandleOwner if the handle is invalid or has no object.

Defined at line 185 of file ../../src/devices/bin/driver_runtime/handle.cc

bool Contains (fdf_handle_t handle_value)

Returns whether the handle exists in the handle table.

Defined at line 101 of file ../../src/devices/bin/driver_runtime/handle.cc

uint32_t num_allocated ()

Returns the number of handles currently allocated (does not include freed handles).

Defined at line 134 of file ../../src/devices/bin/driver_runtime/handle.h