UI: avoid using AT define for malloc id's
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 Dec 2013 16:08:48 +0000 (03:08 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 Dec 2013 17:08:16 +0000 (04:08 +1100)
They're very verbose and while useful for debugging leaks - a unique
string is normally enough to track down the problem.

source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_templates.c

index 5e908849f6261b5db362b3dc07864e22f2afee76..8a4f89af4a30afc7cd10ec0e11d525020af53862 100644 (file)
@@ -6934,7 +6934,7 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *ar)
 
                                if (dyn_data->items_filter_neworder || dyn_data->items_filter_flags) {
                                        /* If we have a display order different from collection order, we have some work! */
-                                       int *org_order = MEM_mallocN(dyn_data->items_shown * sizeof(int), AT);
+                                       int *org_order = MEM_mallocN(dyn_data->items_shown * sizeof(int), __func__);
                                        int *new_order = dyn_data->items_filter_neworder;
                                        int i, org_idx = -1, len = dyn_data->items_len;
                                        int current_idx = -1;
index cd31ff2b7f23bf9b37844170586db694a12cc790..fe167940ecc5e06aa0e2ea741bc391b975326b2a 100644 (file)
@@ -2525,12 +2525,12 @@ static void uilist_filter_items_default(struct uiList *ui_list, struct bContext
                int order_idx = 0, i = 0;
 
                if (order_by_name) {
-                       names = MEM_callocN(sizeof(StringCmp) * len, AT);
+                       names = MEM_callocN(sizeof(StringCmp) * len, "StringCmp");
                }
                if (filter_raw[0]) {
                        size_t idx = 0, slen = strlen(filter_raw);
 
-                       dyn_data->items_filter_flags = MEM_callocN(sizeof(int) * len, AT);
+                       dyn_data->items_filter_flags = MEM_callocN(sizeof(int) * len, "items_filter_flags");
                        dyn_data->items_shown = 0;
 
                        /* Implicitly add heading/trailing wildcards if needed. */
@@ -2538,7 +2538,7 @@ static void uilist_filter_items_default(struct uiList *ui_list, struct bContext
                                filter = filter_buff;
                        }
                        else {
-                               filter = filter_dyn = MEM_mallocN((slen + 3) * sizeof(char), AT);
+                               filter = filter_dyn = MEM_mallocN((slen + 3) * sizeof(char), "filter_dyn");
                        }
                        if (filter_raw[idx] != '*') {
                                filter[idx++] = '*';
@@ -2601,7 +2601,7 @@ static void uilist_filter_items_default(struct uiList *ui_list, struct bContext
                         */
                        qsort(names, order_idx, sizeof(StringCmp), cmpstringp);
 
-                       dyn_data->items_filter_neworder = MEM_mallocN(sizeof(int) * order_idx, AT);
+                       dyn_data->items_filter_neworder = MEM_mallocN(sizeof(int) * order_idx, "items_filter_neworder");
                        for (new_idx = 0; new_idx < order_idx; new_idx++) {
                                dyn_data->items_filter_neworder[names[new_idx].org_idx] = new_idx;
                        }
@@ -2790,13 +2790,13 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
        ui_list = BLI_findstring(&ar->ui_lists, ui_list_id, offsetof(uiList, list_id));
 
        if (!ui_list) {
-               ui_list = MEM_callocN(sizeof(uiList), AT);
+               ui_list = MEM_callocN(sizeof(uiList), "uiList");
                BLI_strncpy(ui_list->list_id, ui_list_id, sizeof(ui_list->list_id));
                BLI_addtail(&ar->ui_lists, ui_list);
        }
 
        if (!ui_list->dyn_data) {
-               ui_list->dyn_data = MEM_callocN(sizeof(uiListDyn), AT);
+               ui_list->dyn_data = MEM_callocN(sizeof(uiListDyn), "uiList.dyn_data");
        }
        dyn_data = ui_list->dyn_data;
 
@@ -2836,7 +2836,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
                items_shown = dyn_data->items_shown;
                if (items_shown >= 0) {
                        bool activei_mapping_pending = true;
-                       items_ptr = MEM_mallocN(sizeof(_uilist_item) * items_shown, AT);
+                       items_ptr = MEM_mallocN(sizeof(_uilist_item) * items_shown, __func__);
                        //printf("%s: items shown: %d.\n", __func__, items_shown);
                        RNA_PROP_BEGIN (dataptr, itemptr, prop)
                        {