class HandleTableArena

Defined at line 96 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 105 of file ../../src/devices/bin/driver_runtime/handle.h

void ~HandleTableArena ()

Defined at line 107 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 127 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 150 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 186 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 195 of file ../../src/devices/bin/driver_runtime/handle.cc

fit::nullable<Handle *> GetExistingHandle (uint32_t table, uint32_t index)

Returns the handle located in the handle table pointed to by |table|, at |index|.

Returns nullptr if the indexes are invalid, or do not point to an allocated handle.

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 151 of file ../../src/devices/bin/driver_runtime/handle.h