mdbx-doc: уточнение формулировок о SIGSEGV и недопустимости прямого изменения данных.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-10-08 11:55:30 +03:00
parent 6027348651
commit e21e91ad1f
2 changed files with 33 additions and 6 deletions

View File

@ -29,6 +29,8 @@ and [by Yandex](https://translated.turbopages.org/proxy_u/ru-en.en/https/gitflic
- Микрооптимизация и рефакториг `cursor_put_nochecklen()` в продолжение исправления - Микрооптимизация и рефакториг `cursor_put_nochecklen()` в продолжение исправления
регресса/ошибки в пути обработки `put(MDBX_MULTIPLE)`. регресса/ошибки в пути обработки `put(MDBX_MULTIPLE)`.
- Уточнение формулировок о `SIGSEGV` и недопустимости прямого изменения данных.
Мелочи: Мелочи:
- Исправление несущественных предупреждений при `MDBX_ENABLE_PROFGC=ON`. - Исправление несущественных предупреждений при `MDBX_ENABLE_PROFGC=ON`.

37
mdbx.h
View File

@ -2846,9 +2846,9 @@ LIBMDBX_INLINE_API(int, mdbx_env_get_syncperiod,
* *
* Only a single thread may call this function. All transactions, databases, * Only a single thread may call this function. All transactions, databases,
* and cursors must already be closed before calling this function. Attempts * and cursors must already be closed before calling this function. Attempts
* to use any such handles after calling this function will cause a `SIGSEGV`. * to use any such handles after calling this function is UB and would cause
* The environment handle will be freed and must not be used again after this * a `SIGSEGV`. The environment handle will be freed and must not be used again
* call. * after this call.
* *
* \param [in] env An environment handle returned by * \param [in] env An environment handle returned by
* \ref mdbx_env_create(). * \ref mdbx_env_create().
@ -4398,9 +4398,14 @@ LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del);
* items requires the use of \ref mdbx_cursor_get(). * items requires the use of \ref mdbx_cursor_get().
* *
* \note The memory pointed to by the returned values is owned by the * \note The memory pointed to by the returned values is owned by the
* database. The caller need not dispose of the memory, and may not * database. The caller MUST not dispose of the memory, and MUST not modify it
* modify it in any way. For values returned in a read-only transaction * in any way regardless in a read-only nor read-write transactions!
* any modification attempts will cause a `SIGSEGV`. * For case a database opened without the \ref MDBX_WRITEMAP modification
* attempts likely will cause a `SIGSEGV`. However, when a database opened with
* the \ref MDBX_WRITEMAP or in case values returned inside read-write
* transaction are located on a "dirty" (modified and pending to commit) pages,
* such modification will silently accepted and likely will lead to DB and/or
* data corruption.
* *
* \note Values returned from the database are valid only until a * \note Values returned from the database are valid only until a
* subsequent update operation, or the end of the transaction. * subsequent update operation, or the end of the transaction.
@ -4834,6 +4839,16 @@ LIBMDBX_API int mdbx_cursor_copy(const MDBX_cursor *src, MDBX_cursor *dest);
* to which data refers. * to which data refers.
* \see mdbx_get() * \see mdbx_get()
* *
* \note The memory pointed to by the returned values is owned by the
* database. The caller MUST not dispose of the memory, and MUST not modify it
* in any way regardless in a read-only nor read-write transactions!
* For case a database opened without the \ref MDBX_WRITEMAP modification
* attempts likely will cause a `SIGSEGV`. However, when a database opened with
* the \ref MDBX_WRITEMAP or in case values returned inside read-write
* transaction are located on a "dirty" (modified and pending to commit) pages,
* such modification will silently accepted and likely will lead to DB and/or
* data corruption.
*
* \param [in] cursor A cursor handle returned by \ref mdbx_cursor_open(). * \param [in] cursor A cursor handle returned by \ref mdbx_cursor_open().
* \param [in,out] key The key for a retrieved item. * \param [in,out] key The key for a retrieved item.
* \param [in,out] data The data of a retrieved item. * \param [in,out] data The data of a retrieved item.
@ -4860,6 +4875,16 @@ LIBMDBX_API int mdbx_cursor_get(MDBX_cursor *cursor, MDBX_val *key,
* array to which `pairs` refers. * array to which `pairs` refers.
* \see mdbx_cursor_get() * \see mdbx_cursor_get()
* *
* \note The memory pointed to by the returned values is owned by the
* database. The caller MUST not dispose of the memory, and MUST not modify it
* in any way regardless in a read-only nor read-write transactions!
* For case a database opened without the \ref MDBX_WRITEMAP modification
* attempts likely will cause a `SIGSEGV`. However, when a database opened with
* the \ref MDBX_WRITEMAP or in case values returned inside read-write
* transaction are located on a "dirty" (modified and pending to commit) pages,
* such modification will silently accepted and likely will lead to DB and/or
* data corruption.
*
* \param [in] cursor A cursor handle returned by \ref mdbx_cursor_open(). * \param [in] cursor A cursor handle returned by \ref mdbx_cursor_open().
* \param [out] count The number of key and value item returned, on success * \param [out] count The number of key and value item returned, on success
* it always be the even because the key-value * it always be the even because the key-value