| 68 | }; |
| 69 | |
| 70 | [[nodiscard]] static PlutoBuffer* checkbuffer (lua_State *L, int i) { |
| 71 | const auto buf = (PlutoBuffer*)luaL_checkudata(L, i, "pluto:buffer"); |
| 72 | #ifdef PLUTO_MEMORY_LIMIT |
| 73 | buf->allocator.L = L; |
| 74 | #endif |
| 75 | return buf; |
| 76 | } |
| 77 | |
| 78 | static int buffer_new (lua_State *L) { |
| 79 | new (lua_newuserdata(L, sizeof(PlutoBuffer))) PlutoBuffer{}; |
no test coverage detected