return NULL;
}
+tbm_bo
+tbm_bufmgr_internal_alloc_bo(tbm_bufmgr bufmgr, int size, int flags, tbm_error_e *error)
+{
+ tbm_bo bo;
+ tbm_backend_bo_data *bo_data;
+
+ _tbm_bufmgr_check_bo_cnt(bufmgr);
+
+ bo = calloc(1, sizeof(struct _tbm_bo));
+ if (!bo) {
+ /* LCOV_EXCL_START */
+ TBM_ERR("memory allocationc failed.");
+ *error = TBM_ERROR_OUT_OF_MEMORY;
+ return NULL;
+ /* LCOV_EXCL_STOP */
+ }
+
+ bo_data = tbm_module_bufmgr_bo_alloc(bufmgr->module, bo, size, flags, error);
+ if (!bo_data) {
+ /* LCOV_EXCL_START */
+ TBM_ERR("tbm_module_bufmgr_bo_alloc failed. size:%d flags:%s error:%d", size, _tbm_flag_to_str(flags), *error);
+ free(bo);
+ return NULL;
+ /* LCOV_EXCL_STOP */
+ }
+ bo->bo_data = bo_data;
+ bo->priv = (void *)bo_data; // TODO: this will be DEPRECATED.
+
+ _tbm_bufmgr_initialize_bo(bufmgr, bo, flags);
+
+ return bo;
+}
+
+
/* LCOV_EXCL_START */
tbm_bo