diff options
author | Lioncash <mathew1800@gmail.com> | 2019-02-25 16:13:52 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-02-25 17:12:32 +0100 |
commit | 5167d1577d6b4074f46ad90864d6e0d6119089a3 (patch) | |
tree | 8debfe33cc6f0abefb1c5dbb8ae6c01bf9b0e932 /src/core/hle/kernel/handle_table.h | |
parent | kernel/handle-table: In-class initialize data members (diff) | |
download | yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.tar yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.tar.gz yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.tar.bz2 yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.tar.lz yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.tar.xz yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.tar.zst yuzu-5167d1577d6b4074f46ad90864d6e0d6119089a3.zip |
Diffstat (limited to 'src/core/hle/kernel/handle_table.h')
-rw-r--r-- | src/core/hle/kernel/handle_table.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/hle/kernel/handle_table.h b/src/core/hle/kernel/handle_table.h index 5fa55c783..44901391b 100644 --- a/src/core/hle/kernel/handle_table.h +++ b/src/core/hle/kernel/handle_table.h @@ -50,6 +50,20 @@ public: ~HandleTable(); /** + * Sets the number of handles that may be in use at one time + * for this handle table. + * + * @param handle_table_size The desired size to limit the handle table to. + * + * @returns an error code indicating if initialization was successful. + * If initialization was not successful, then ERR_OUT_OF_MEMORY + * will be returned. + * + * @pre handle_table_size must be within the range [0, 1024] + */ + ResultCode SetSize(s32 handle_table_size); + + /** * Allocates a handle for the given object. * @return The created Handle or one of the following errors: * - `ERR_HANDLE_TABLE_FULL`: the maximum number of handles has been exceeded. @@ -104,6 +118,13 @@ private: std::array<u16, MAX_COUNT> generations; /** + * The limited size of the handle table. This can be specified by process + * capabilities in order to restrict the overall number of handles that + * can be created in a process instance + */ + u16 table_size = static_cast<u16>(MAX_COUNT); + + /** * Global counter of the number of created handles. Stored in `generations` when a handle is * created, and wraps around to 1 when it hits 0x8000. */ |