sbuf_c.h (1277B)
1 /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef SBUF_C_H 17 #define SBUF_C_H 18 19 #include <rsys/logger.h> 20 #include <rsys/ref_count.h> 21 22 struct mem_allocator; 23 24 struct sbuf { 25 uint64_t pagesize; 26 uint64_t size; /* #items */ 27 uint64_t szitem; /* Size of an item in bytes */ 28 uint64_t alitem; /* Alignment of an item in bytes */ 29 uint64_t pitch; /* #bytes between 2 consecutive items */ 30 31 void* buffer; 32 size_t map_len; 33 34 size_t pagesize_os; 35 36 struct mem_allocator* allocator; 37 struct logger* logger; 38 struct logger logger__; /* Default logger */ 39 int verbose; 40 ref_T ref; 41 }; 42 43 #endif /* SBUF_C_H */