mbuf mbuf_get(struct mbuf_pool *pool) { struct mbuf_block *block = mbuf_block_get(pool); if (OXT_UNLIKELY(block == NULL)) { return mbuf(); } assert(block->refcount == 1); block->refcount--; return mbuf(block, 0, block->end - block->start); }
void __cdecl _freebuf ( REG1 FILE *stream ) { _ASSERTE(stream != NULL); if (inuse(stream) && mbuf(stream)) { _free_crt(stream->_base); stream->_flag &= ~(_IOMYBUF | _IOSETVBUF); stream->_base = stream->_ptr = NULL; stream->_cnt = 0; } }
mbuf mbuf_block_subset(struct mbuf_block *mbuf_block, unsigned int start, unsigned int len) { return mbuf(mbuf_block, start, len); }