/* * mem_try_ensure_space: * @mio: A #MIO object * @n: Requested size from the current (cursor) position * * Tries to ensure there is enough space for @n bytes to be written from the * current cursor position. * * Returns: %TRUE if there is enough space, %FALSE otherwise. */ static int mem_try_ensure_space (MIO *mio, size_t n) { int success = TRUE; if (mio->impl.mem.pos + n > mio->impl.mem.size) success = mem_try_resize (mio, mio->impl.mem.pos + n); return success; }
/* * mem_try_ensure_space: * @mio: A #MIO object * @n: Requested size from the current (cursor) position * * Tries to ensure there is enough space for @n bytes to be written from the * current cursor position. * * Returns: %TRUE if there is enough space, %FALSE otherwise. */ static gboolean mem_try_ensure_space (MIO *mio, gsize n) { gboolean success = TRUE; if (mio->impl.mem.pos + n > mio->impl.mem.size) { success = mem_try_resize (mio, mio->impl.mem.pos + n); } return success; }