forked from enlightenment/efl
evas mem - remove redundenty unused evas mem absraction
was never used as was not practical to do so so it effectively does nothing so remove it to reduce analyser warnings found by PVS studio
This commit is contained in:
parent
f4ce0d1b95
commit
6e82f90807
|
@ -35,7 +35,7 @@ evas_key_grab_new(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const ch
|
|||
|
||||
if (have_exclusion && exclusive) return NULL;
|
||||
|
||||
g = evas_mem_calloc(sizeof(Evas_Key_Grab));
|
||||
g = calloc(1, sizeof(Evas_Key_Grab));
|
||||
if (!g) return NULL;
|
||||
g->object = eo_obj;
|
||||
g->modifiers = modifiers;
|
||||
|
@ -46,19 +46,10 @@ evas_key_grab_new(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, const ch
|
|||
g->just_added = EINA_TRUE;
|
||||
g->is_active = EINA_TRUE;
|
||||
if (!g->keyname)
|
||||
{
|
||||
if (!evas_mem_free(strlen(keyname) + 1))
|
||||
{
|
||||
free(g);
|
||||
return NULL;
|
||||
}
|
||||
g->keyname = strdup(keyname);
|
||||
if (!g->keyname)
|
||||
{
|
||||
free(g);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (exclusive)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ evas_object_intercept_init(Evas_Object *eo_obj)
|
|||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
if (!obj->interceptors)
|
||||
obj->interceptors = evas_mem_calloc(sizeof(Evas_Intercept_Func));
|
||||
obj->interceptors = calloc(1, sizeof(Evas_Intercept_Func));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -32,7 +32,7 @@ evas_smart_class_new(const Evas_Smart_Class *sc)
|
|||
/* api does not match abi! for now refuse as we only have 1 version */
|
||||
if (sc->version != EVAS_SMART_CLASS_VERSION) return NULL;
|
||||
|
||||
s = evas_mem_calloc(sizeof(Evas_Smart));
|
||||
s = calloc(1, sizeof(Evas_Smart));
|
||||
if (!s) return NULL;
|
||||
|
||||
s->magic = MAGIC_SMART;
|
||||
|
|
|
@ -1671,8 +1671,6 @@ void evas_object_callback_init(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_
|
|||
void evas_object_callback_shutdown(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_Data *obj);
|
||||
void evas_object_event_callback_call(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Callback_Type type, void *event_info, int event_id, const Efl_Event_Description *efl_event_desc);
|
||||
Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
|
||||
int evas_mem_free(int mem_required);
|
||||
int evas_mem_degrade(int mem_required);
|
||||
void evas_debug_error(void);
|
||||
void evas_debug_input_null(void);
|
||||
void evas_debug_magic_null(void);
|
||||
|
@ -1722,7 +1720,6 @@ void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj);
|
|||
void evas_object_smart_need_bounding_box_update(Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
|
||||
Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
|
||||
void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
|
||||
void *evas_mem_calloc(int size);
|
||||
void _evas_post_event_callback_call_real(Evas *e, Evas_Public_Data* e_pd, int min_event_id);
|
||||
#define _evas_post_event_callback_call(e, pd, id) do { \
|
||||
if (!pd->delete_me && pd->post_events) _evas_post_event_callback_call_real(e, pd, id); } while (0)
|
||||
|
|
|
@ -19,36 +19,6 @@ evas_alloc_error(void)
|
|||
return _evas_alloc_error;
|
||||
}
|
||||
|
||||
/* free cached items only in ram for speed reasons. return 0 if can't free */
|
||||
int
|
||||
evas_mem_free(int mem_required EINA_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* start reducing quality of images etc. return 0 if can't free anything */
|
||||
int
|
||||
evas_mem_degrade(int mem_required EINA_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *
|
||||
evas_mem_calloc(int size)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = calloc(1, size);
|
||||
if (ptr) return ptr;
|
||||
MERR_BAD();
|
||||
while ((!ptr) && (evas_mem_free(size))) ptr = calloc(1, size);
|
||||
if (ptr) return ptr;
|
||||
while ((!ptr) && (evas_mem_degrade(size))) ptr = calloc(1, size);
|
||||
if (ptr) return ptr;
|
||||
MERR_FATAL();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_debug_init_from_env(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue