Skip to content

Commit

Permalink
trivia: add xlsregion_alloc macros
Browse files Browse the repository at this point in the history
A new macro has been introduced because OOM errors are not handled in the
code.

Needed for tarantool#7932

NO_DOC=internal
NO_TEST=internal
NO_CHANGELOG=internal
  • Loading branch information
yanshtunder committed May 22, 2023
1 parent 088b32f commit 0e19a96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/trivia/util.h
Expand Up @@ -135,6 +135,8 @@ strnindex(const char *const *haystack, const char *needle, uint32_t len,
#define xibuf_reserve(p, size) xalloc_impl((size), ibuf_reserve, (p), (size))
#define xruntime_memory_alloc(size) \
xalloc_impl((size), runtime_memory_alloc, (size))
#define xlsregion_alloc(p, size, id) \
xalloc_impl((size), lsregion_alloc, (p), (size), (id))

#define xregion_alloc_object(region, T) ({ \
(T *)xregion_aligned_alloc((region), sizeof(T), alignof(T)); \
Expand Down

0 comments on commit 0e19a96

Please sign in to comment.