From 740aa8d730095e4ee475ac27d702ef5c9e64c7c0 Mon Sep 17 00:00:00 2001 From: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com> Date: Wed, 18 Oct 2023 06:04:01 -0700 Subject: [PATCH] Update type-byte-buffer.md --- rfcs/type-byte-buffer.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rfcs/type-byte-buffer.md b/rfcs/type-byte-buffer.md index 1180fdbb..e4e086e0 100644 --- a/rfcs/type-byte-buffer.md +++ b/rfcs/type-byte-buffer.md @@ -143,6 +143,12 @@ If there is no buffer at the location, `NULL` is returned and `len` is not modif Pushes new buffer of size `l` onto the stack. +`lua_isbuffer(L, n)` + +C macro helper to check if value at the specified location is a buffer. + +Simiar to `lua_istable`/`lua_isvector`/`lua_isthread` it's a simple wrapper over `lua_type` call and doesn't require internal coercions/internal field access like `lua_isnumber`/`lua_iscfunction`. + `void* luaL_checkbuffer(lua_State* L, int narg, size_t* len);` Similar to `lua_tobuffer`, but throws a tag error if there is no buffer at specified location.