X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/frsh-include.git/blobdiff_plain/8f4416dfcf873d7a6b8152f1218ee163f5ee76d5..f4dd1a5b96dc94f178d999e33c39f8f2f10bfd07:/frsh_memory_management.h diff --git a/frsh_memory_management.h b/frsh_memory_management.h index c5d3bc3..f173e1c 100644 --- a/frsh_memory_management.h +++ b/frsh_memory_management.h @@ -95,9 +95,9 @@ FRSH_CPP_BEGIN_DECLS **/ /** - * frsh_contract_set_memory_reqs() + * frsh_contract_set_min_memory() * - * This function specifies in the contract the minimum and maximum + * This function specifies in the contract the minimum * memory needed by the application. * * @param[in] min_memory Minimum needed memory in bytes. @@ -105,29 +105,59 @@ FRSH_CPP_BEGIN_DECLS * @param contract Contract, in-out argument. * * @return 0 if no error \n - * FRSH_ERR_BAD_ARGUMENT if min_memory > max_memory + * FRSH_ERR_BAD_ARGUMENT if min_memory <0 * **/ -int frsh_contract_set_memory_reqs(size_t min_memory, - size_t max_memory, +int frsh_contract_set_min_memory(size_t min_memory, frsh_contract_t *contract); /** - * frsh_contract_get_memory_reqs() + * frsh_contract_get_min_memory() * - * This function gets the memory parameters from the contract. + * This function gets the minimum memory parameter from the contract. * * @param[in] contract Contract object * @param[out] min_memory Placeholder for the minimum required * memory. + * + * @return 0 if no error \n + * FRSH_ERR_BAD_ARGUMENT if one of the pointers is NULL + **/ +int frsh_contract_get_min_memory(const frsh_contract_t *contract, + size_t *min_memory); + +// frsh_contract_set_max_memory() is new +// frsh_contract_get_max_memory() is new + +/** + * frsh_contract_set_max_memory() + * + * This function specifies in the contract the minimum + * memory needed by the application. + * + * @param[in] max_memory Maximum needed memory in bytes. + * @param contract Contract, in-out argument. + * + * FRSH_ERR_BAD_ARGUMENT if min_memory > max_memory + * + **/ +int frsh_contract_set_max_memory(size_t max_memory, + frsh_contract_t *contract); + + +/** + * frsh_contract_get_max_memory() + * + * This function gets the maximum memory parameter from the contract. + * + * @param[in] contract Contract object * @param[out] max_memory Placeholder for the maximum required * memory. * * @return 0 if no error \n * FRSH_ERR_BAD_ARGUMENT if one of the pointers is NULL **/ -int frsh_contract_get_memory_reqs(const frsh_contract_t *contract, - size_t *min_memory, +int frsh_contract_get_max_memory(const frsh_contract_t *contract, size_t *max_memory);