diff --git a/Makefile b/Makefile index 10c938604b..9b16a0f5e7 100644 --- a/Makefile +++ b/Makefile @@ -101,6 +101,13 @@ ifneq ($(SANITIZER),) LDFLAGS := -fsanitize=$(SANITIZER) $(LDLAGS) endif +ifneq ($(findstring $(GPERFTOOLS),profiler),) + LIBS += -lprofiler +endif +ifneq ($(findstring $(GPERFTOOLS),tcmalloc),) + LIBS += -ltcmalloc +endif + all: $(TARGET) config.mk -include $(RARCH_OBJ:.o=.d) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 397d670310..020c711fa8 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -629,8 +629,8 @@ static int generic_action_ok(const char *path, if (path_file_exists(action_path)) { strlcpy(settings->menu.wallpaper, action_path, sizeof(settings->menu.wallpaper)); - rarch_task_push_image_load(action_path, - "cb_menu_wallpaper", menu_display_handle_wallpaper_upload); + rarch_task_push_image_load(action_path, "cb_menu_wallpaper", + menu_display_handle_wallpaper_upload, NULL); } break; case ACTION_OK_LOAD_CORE: diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 5e2f33805a..4387bd93ad 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -1165,7 +1165,7 @@ static void mui_context_reset(void) mui_context_reset_textures(mui, iconpath); rarch_task_push_image_load(settings->menu.wallpaper, "cb_menu_wallpaper", - menu_display_handle_wallpaper_upload); + menu_display_handle_wallpaper_upload, NULL); } static int mui_environ(menu_environ_cb_t type, void *data) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index e94c4dcfc8..ea0bed29cb 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -547,7 +547,7 @@ static void xmb_update_boxart_image(xmb_handle_t *xmb) { if (path_file_exists(xmb->boxart_file_path)) rarch_task_push_image_load(xmb->boxart_file_path, "cb_menu_boxart", - menu_display_handle_boxart_upload); + menu_display_handle_boxart_upload, NULL); else if (xmb->depth == 1) xmb->boxart = 0; } @@ -818,9 +818,12 @@ static void xmb_list_switch_new(xmb_handle_t *xmb, if (!path_file_exists(path)) xmb_fill_default_background_path(xmb, path, sizeof(path)); - if(strcmp(path, xmb->background_file_path) != 0) { - if(path_file_exists(path)) { - rarch_task_push_image_load(path, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload); + if(strcmp(path, xmb->background_file_path) != 0) + { + if(path_file_exists(path)) + { + rarch_task_push_image_load(path, "cb_menu_wallpaper", + menu_display_handle_wallpaper_upload, NULL); strlcpy(xmb->background_file_path, path, sizeof(xmb->background_file_path)); } } @@ -2253,7 +2256,8 @@ static void xmb_context_reset_background(const char *iconpath) strlcpy(path, settings->menu.wallpaper, sizeof(path)); if (path_file_exists(path)) - rarch_task_push_image_load(path, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload); + rarch_task_push_image_load(path, "cb_menu_wallpaper", + menu_display_handle_wallpaper_upload, NULL); } static void xmb_context_reset(void) diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 963fb14bd7..8833977ed7 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -1111,7 +1111,7 @@ static void *zarch_init(void) if (settings->menu.wallpaper[0] != '\0') rarch_task_push_image_load(settings->menu.wallpaper, - "cb_menu_wallpaper", menu_display_handle_wallpaper_upload); + "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); zui->ca.allocated = 0; @@ -1230,7 +1230,7 @@ static void zarch_context_reset(void) zarch_context_bg_destroy(zui); rarch_task_push_image_load(settings->menu.wallpaper, - "cb_menu_wallpaper", menu_display_handle_wallpaper_upload); + "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); zarch_allocate_white_texture(zui); diff --git a/tasks/task_file_transfer.c b/tasks/task_file_transfer.c index 88696086a7..727353505b 100644 --- a/tasks/task_file_transfer.c +++ b/tasks/task_file_transfer.c @@ -311,7 +311,7 @@ static int cb_nbio_image_menu_boxart(void *data, size_t len) #endif #endif -bool rarch_task_push_image_load(const char *fullpath, const char *type, rarch_task_callback_t cb) +bool rarch_task_push_image_load(const char *fullpath, const char *type, rarch_task_callback_t cb, void *user_data) { #if defined(HAVE_RPNG) && defined(HAVE_MENU) rarch_task_t *t; @@ -348,6 +348,7 @@ bool rarch_task_push_image_load(const char *fullpath, const char *type, rarch_ta t->state = nbio; t->handler = rarch_task_file_load_handler; t->callback = cb; + t->user_data = user_data; rarch_task_push(t); #endif diff --git a/tasks/tasks.h b/tasks/tasks.h index 009f53420d..f571e7a385 100644 --- a/tasks/tasks.h +++ b/tasks/tasks.h @@ -73,7 +73,7 @@ typedef struct { bool rarch_task_push_http_transfer(const char *url, const char *type, rarch_task_callback_t cb, void *user_data); #endif -bool rarch_task_push_image_load(const char *fullpath, const char *type, rarch_task_callback_t cb); +bool rarch_task_push_image_load(const char *fullpath, const char *type, rarch_task_callback_t cb, void *user_data); #ifdef HAVE_LIBRETRODB bool rarch_task_push_dbscan(const char *fullpath, bool directory, rarch_task_callback_t cb);