eo class add - dont always call getenv as this is epxensive. get once

so class creation is possibly a little slower thanks to always calling
getenv. get once then store rsult from there on out.
This commit is contained in:
Carsten Haitzler 2016-09-09 11:19:01 +09:00
parent 26a60e1eb3
commit 54c39aa564
1 changed files with 8 additions and 1 deletions

View File

@ -1335,7 +1335,14 @@ efl_class_new(const Efl_Class_Description *desc, const Efl_Class *parent_id, ...
}
klass->obj_size = extn_data_off;
if (getenv("EO_DEBUG"))
static unsigned char _eo_debug = 0;
if (_eo_debug == 0)
{
if (getenv("EO_DEBUG")) _eo_debug = 2;
else _eo_debug = 1;
}
if (_eo_debug == 2)
{
fprintf(stderr, "Eo class '%s' will take %u bytes per object.\n",
desc->name, klass->obj_size);