Commit Graph

35 Commits

Author SHA1 Message Date
Guilherme Iscaro 5bd8c9a78d Eina: Add Eina_Promise/Eina_Future.
This commit adds a new promise/future API which aims to replace
efl_future.
2017-09-04 10:24:00 -03:00
Daniel Zaoui 5f268ec26a First patch of the Eina Debug layer rewriting
Eina Debug is a new layer aimed for EFL debugging. It offers scalability
by allowing registration of operations not specific to EFL core.

The protocol is simple and the APIs try to provide as much
functionalities/freedom as possible.
2017-06-05 08:51:49 +03:00
Myoungwoon Roy, Kim ec71f6607a docs: Fix typos and some wrong expressions in Eina API reference doxygen.
Summary: I had fixed some typos and some wrong expressions, such as capital letters, singular, and orders of groups in Eina API reference doxygen.

Test Plan: Doxygen Revision

Reviewers: stefan, cedric, raster, Jaehyun_Cho, jpeg

Reviewed By: jpeg

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4674
2017-02-21 10:46:28 +09:00
Jean-Philippe Andre 4550b4cf83 eina: Introduce Eina_Slstr for short-lived strings
Built on top of the new 'postponed' free queue, the short-lived
strings API allows users to return new strings without caring
about freeing them. EFL main loop will do this automatically for
them you at a later point in time (at the end of an iteration).

The APIs provided will either duplicate (copy) or more generally
steal an existing string (char *, stringshare, tmpstr, strbuf),
taking ownership of it and controling its lifetime. Those strings
can then be safely returned by an API. From a user point of view,
those strings must be considered like simple const char *, ie.
no need to free() them and their validity is limited to the
local scope.

There is no function to remove such a string from the freeq.

The short lived strings API is not thread-safe: do not send a
short-lived object from one thread to another.

@feature
2017-01-17 14:20:55 +09:00
Bruno Dilly adb95630ef eina: remove tests, examples and docs for eina_model
Summary:
Since eina_model was dropped some years ago.
Also a few other points where related stuff is just commented out.

Reviewers: iscaro, barbieri

Reviewed By: barbieri

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4442
2016-11-30 18:37:34 -02:00
Cedric BAIL de131bf5d0 eina: remove Eina_Promise. 2016-11-07 13:43:11 -08:00
Carsten Haitzler 0ee33e7b4b eina - add a free queue (eina_freeq) for deferring frees of data
this adds eina_freeq api's for c land for deferring freeing of
pointers and can be used a s a simple copy & paste drop-in for free()
just to "do this later". the pointer will eveentually be freed as
eina_shutdown will free the main free queue and this will in turn free
everything in it. as long as the main lo0op keeps pumping things will
og on the queue and then be freed from it. free queues have limits so
if they get full they will clear out old pointers and free them so it
won't grow without bound. the default max is 1mb of data or 16384
items whichever limit is hit first and at that point the oldest item
will be freed to make room for the newest. the mainloop whenever it
finishes idle enterers will add an idler to spin and free while idle.
the sizes can be tuned and aruged about as to what defaults should be.

this also allows for better memory debugging too by being able to fill
freed memory with patterns if its small enough etc. etc.

@feature
2016-11-06 13:13:10 +09:00
Gustavo Sverzut Barbieri 960e1a1d16 eina/ecore: allow threads to be canceled, use in ecore_con.
As discussed in the mailing list, many people will use worker threads
to execute blocking syscalls and mandating ecore_thread_check() for
voluntary preemption reduces the ecore_thread usefulness a lot.

A clear example is ecore_con usage of connect() and getaddrinfo() in
threads. If the connect timeout expires, the thread will be cancelled,
but it was blocked on syscalls and they will hang around for long
time. If the application exits, ecore will print an error saying it
can SEGV.

Then enable access to pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)
via eina_thread_cancellable_set(EINA_TRUE), to pthread_cancel() via
eina_thread_cancel(), to pthread_cleanup_push()/pthread_cleanup_pop()
via EINA_THREAD_CLEANUP_PUSH()/EINA_THREAD_CLEANUP_POP() and so on.

Ecore threads will enforce non-cancellable threads on its own code,
but the user may decide to enable that and allow cancellation, that's
not an issue since ecore_thread now plays well and use cleanup
functions.

Ecore con connect/resolve make use of that and enable cancellable
state, efl_net_dialer_tcp benefits a lot from that.

A good comparison of the benefit is to run:

   ./src/examples/ecore/efl_io_copier_example tcp://google.com:1234 :stdout:

before and after. It will timeout after 30s and with this patch the
thread is gone, no ecore error is printed about possible SEGV.
2016-09-14 01:47:23 -03:00
Gustavo Sverzut Barbieri 9062bbd8e0 eina: introduce Eina_Slice and Eina_Rw_Slice.
A plain simple pointer + length describing a linear memory region.
2016-08-22 18:25:14 -03:00
Cedric BAIL 692b2c9fc9 eina: add generic infrastructure for a Eina_Safepointer
This is heavily inspired from Eo_Id infrastructure. Main change
are that the lower bit are always guaranteed to be zero and ignored
by all function. Also it may be a little bit less efficient in some
case, but we will tune it once we have real life usage of it.

Eo won't be migrated for 1.18 to it as Eo_Id is deeply integrated
and it is quite risky to touch it so close from a freeze. This can
wait.
2016-06-10 13:57:01 -07:00
Felipe Magno de Almeida 09eea7bc01 eina: add promise
Add a promise object that will allows Eolian interface to include promises
as a way to have asynchronous value return and composibility.

To understand better, let see the coming usage in a .eo file:

class Foo {
   methods {
      bar {
         params {
            @inout promise: Promise<int>;
         }
      }
   }
}

Which will create the following API interface:

void foo_bar(Eo* obj, Eina_Promise** promise);

and the equivalent declaration for implementation.

However, the API function will instantiate the Promise for the user
and the implementer of the class automatically. So the user of this
function will treat it as a @out parameter, while the developer of the
function will treat it like a @inout parameter.

So, the user will use this function like this:

Eina_Promise* promise; // No need to instantiate
foo_bar(obj, &promise);
eina_promise_then(promise, callback);

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-04-05 11:35:12 -07:00
Jean-Philippe Andre d488926cb6 Eina: Move vector2 to eina_inline_vector.x
For consistency.

Also, include inside Eina.h
Thanks @vtorri for the remark.
2016-01-07 19:18:35 +09:00
Subhransu Mohanty ddb8515930 eina: add Eina_Bezier infrastructure for manipulating cubic bezier curves. 2015-08-07 14:33:52 +02:00
Cedric BAIL 0acf23857f eina: beginning of a generic quaternion API. 2015-05-29 17:20:29 +02:00
Vincent Torri dbc6cbb953 eina: add crosss platforme API to retrieve tmp and home directories from environment.
@feature

No tests added as it is highly dependent on the system and it would make little sens.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-14 18:41:48 +02:00
Carsten Haitzler 2aeb289063 eina - begin event log infra we can get from the new debug monitor
we can down dump event logs. some ecore mainloop bits are logging at
the moment.
2015-05-10 19:05:54 +09:00
Cedric BAIL 0dfb263a28 eina: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
vivek a2f2d942c6 eina: add CRC implementation to Eina module.
Summary:
Added eina_crc function in eina to calculate crc for the key passed and
added eina_hash_crc function for hashing using crc

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: Sergeant_Whitespace, cedric

Reviewed By: cedric

Subscribers: Sergeant_Whitespace, cedric

Differential Revision: https://phab.enlightenment.org/D2260

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +02:00
Cedric BAIL 659d3c4fd7 eina: add eina_matrix.
This code come from Enesim and was done by Jorge. I did just take care
of changing the namespace and coding style.
2015-04-03 16:12:48 +02:00
Tae-Hwan Kim dbe87afd63 eina: documentation enhance - add @brief tag
Summary: Add @brief for brief description

Reviewers: raster, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1577

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-10-27 09:08:47 +01:00
Ghislain Loaec 604d3ae8a2 eina: Eina_Cpu / Eina_Thread API documentation 2014-10-20 18:17:14 +02:00
Mike Blumenkrantz d7f729343b add eina_value_util.h to Eina.h 2014-09-23 15:56:46 -04:00
bluezery 8f30d8a949 Eina: Change from "" to <> for header inclusion
Summary:
All eina_xxx.h are expored headers.
Using system path to search eina headers seems to be better.

Reviewers: raster, stefan_schmidt, stefan, cedric

Subscribers: stefan_schmidt, cedric

Differential Revision: https://phab.enlightenment.org/D1079
2014-08-02 21:10:37 +02:00
Carsten Haitzler 3c130836ad new eina api/object - eina thread queues
@feature

This is a new feature for eina (and EFL) - a zero-copy thread message
queue for sending messages from one thread to another or from the
ecore mainloop to or back to the mainloop from threads. It has a
complete test suite too.
2014-07-15 20:39:13 +09:00
Daniel Juyung Seo a7399da8f6 Eina.h: bump up year. 2013-08-20 03:11:48 +09:00
Cedric BAIL 0e50f122e5 efl: Add eina copy on write infrastructure.
SVN revision: 82396
2013-01-08 09:17:56 +00:00
Gustavo Sverzut Barbieri 0a2d116119 efl: eina_alloca.h to simplify alloca() usage.
having to replicate 18 lines per file just to access alloca() is
insane. Let's do that in Eina.h and avoid that crap :-/



SVN revision: 82082
2013-01-03 15:10:34 +00:00
Gustavo Sverzut Barbieri 2608f68571 efl/docs: clean-up and make it more uniform.
now unified docs are bit more uniform in their start pages, overall
improved but much to do :-(



SVN revision: 81851
2012-12-28 23:26:05 +00:00
Gustavo Sverzut Barbieri e86d9e0dd9 efl/eina: fix doc for content access
SVN revision: 81831
2012-12-28 19:08:42 +00:00
Jonas M. Gastal a6b491fc01 efl: Created Eina group and added existing Eina groups to it.
SVN revision: 81290
2012-12-18 18:38:25 +00:00
Jonas M. Gastal d41d76ca38 efl: Modified section names as doxygen reuses titles for same named sections in different pages.
SVN revision: 81279
2012-12-18 16:18:28 +00:00
Jonas M. Gastal 65a7188905 efl: Unifying authors page.
SVN revision: 81277
2012-12-18 16:18:19 +00:00
Jonas M. Gastal 6ecaa33f22 efl: Adding a unified main page that links to the "mainpage" of libs.
SVN revision: 81273
2012-12-18 16:12:56 +00:00
Cedric BAIL 903bbfba82 efl: add Eina_Thread API.
SVN revision: 78225
2012-10-19 05:47:33 +00:00
Carsten Haitzler 0a5ba96837 move eina headers into lib/eina like the rest of efl - at least be
consistent with the majority.



SVN revision: 77119
2012-09-27 04:02:37 +00:00