Eo
Date
2012 (created)

Table of Contents

Introduction

The Eo generic object system. It's designed to be the base object system for the EFL.

How to compile

Eo is a library to which your application can link. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the pkg-config script outputs. For example:

Compiling C or C++ files into object files:

  gcc -c -o main.o main.c `pkg-config --cflags eo`

Linking object files into a binary executable:

  gcc -o my_application main.o `pkg-config --libs eo`

See pkgconfig

Next Steps

After you've understood and installed Eo, you can then learn more about the programming interface.

Recommended reading:

Debug Object Lifecycle

When dealing with objects it's important to investigate the object lifecycle: in other words when they were created and deleted. This is not that trivial since objects can have extra references added with efl_ref() as well as removed with efl_unref(), efl_parent_set() to NULL or efl_del().

To aid development process as well as debug memory leaks and invalid access, you can use the eo_debug script helper to preload libeo_dbg.so, run as:

  export EO_LIFECYCLE_DEBUG=1
  export EINA_LOG_LEVELS=eo_lifecycle:4
  eo_debug my_app
* 

This will print out all the objects that were created and deleted, as well as keep the stack trace that originated those. If a double free or user-after-free occurs it will print out the backtrace where the object was created and where it was deleted. If only errors should be displayed decrease the log level to 2:

  export EO_LIFECYCLE_DEBUG=1
  export EINA_LOG_LEVELS=eo_lifecycle:2  # just critical, error and warning
  eo_debug my_app
* 

Keep in mind that the log will consume memory for all objects and that main loop primitives such as timers, jobs, promises and futures are all objects. If created in large numbers, they will consume large amounts of of memory.

To address log pollution and memory consumption, you can select just a handful classes to be logged using EO_LIFECYCLE_DEBUG with a list of comma-separated class names. Use EO_LIFECYCLE_DEBUG=1 or EO_LIFECYCLE_DEBUG=* to log all classes, otherwise just the classes listed will be (whitelist).

  # Log only 2 classes: Efl_Loop and Efl_Net_Dialer_Tcp
  export EO_LIFECYCLE_DEBUG=Efl_Loop,Efl_Net_Dialer_Tcp
  export EINA_LOG_LEVELS=eo_lifecycle:4
  eo_debug my_app
* 

Another approach is to log all but a few classes, also known as a blacklist. This is done with another environment variable EO_LIFECYCLE_NO_DEBUG=class1,class2.

  # Log all but Efl_Loop_Timer
  export EO_LIFECYCLE_NO_DEBUG=Efl_Loop_Timer
  export EINA_LOG_LEVELS=eo_lifecycle:4
  eo_debug my_app
* 

Introductory Example

Eo Tutorial