Commit Graph

100 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri d9815a6837 CMake: move eina binaries to single dir, add helper macros.
For one-source directories, be smart and just define SOURCES to that,
will reduce the number of too-simplistic CMakeLists.txt in our tree.

This also fixes problems with libraries, they should be private, not
public. So specify both kinds as different variables.
2017-01-23 18:23:40 +01: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
Cedric BAIL 95e1cefb40 eina: add test for all float/double util function. 2017-01-06 15:58:46 -08:00
Cedric BAIL 8519ae4481 eina: include forgotten test file in release tarball. 2017-01-06 15:58:46 -08:00
Cedric BAIL 8e7d7d9d58 eina: move to use memcmp and rename eina_{flt,dbl}eq to eina_{flt,dbl}_exact. 2017-01-06 15:58:46 -08:00
Cedric BAIL 18f41e12bc eina: try slight improvement of eina tests suite.
Still need to go through individual test to improve them.
2016-12-21 16:40:22 -08:00
Cedric BAIL de131bf5d0 eina: remove Eina_Promise. 2016-11-07 13:43:11 -08:00
Cedric BAIL e842c79ff3 eina: remove Eina_Promise tests. 2016-11-07 11:23:59 -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
Derek Foreman e2875cefc4 eina_cpu, evas: Remove _eina_cpu_fast_core_get, don't set render thread affinity
We've decided it would be best to just let the scheduler do its job.
2016-09-20 11:38:57 -05:00
Carsten Haitzler 41c332b726 eina - redo a lot of the static inlines to have better instr cache usage
this moves a lot of logic that is rare away from the linear/flat asm
path of code so we et fewer l1 cache misses when executing chuncks of
our code. this also reduces the code size and takes some funcs like in
eina_inline_lock_posix.x and makes them real functions to reduce code
size thus better l1 cache usage - only for new/free of locks.
spinlocks, semaphores etc. as these will have no advantage being
inlined but simply bloat out code size instead.

overall this actually reduces efl lib binary sizes 0.4%, so that's a
good sign.

this passes make check and i think i got it right... let me know if i
didn't. i'm also not sure i should just keep the static inlines and
not make the formerly static inline funcs full EAPI ones now... good q.
2016-09-20 14:53:05 +09:00
Derek Foreman 13da63d260 eina_cpu: Add an internal api for getting a random fast core
In a big.LITTLE ARM system cores can have different capabilities.  This
gives an internal API that randomly returns the core id of any of the
system's fastest cores.

On systems where all cores are the same, it will return any available core.

If we don't have cpufreq support we just return 0
2016-09-16 14:10:49 -05:00
Amitesh Singh d88f08f7e9 eina: module - Add macros for adding module informations
Summary:
These macros allow you to define module informations like
author/description/version/license

e.g.
// Use "Name <email id>" or just "Name"
EINA_MODULE_AUTHOR("Enlightenment Community");
// Mention license
EINA_MODULE_LICENSE("GPL v2");
// What your module does
EINA_MODULE_DESCRIPTION("This is what this module does");
// Module version
EINA_MODULE_VERSION("0.1");

Now eina_modinfo can show these informations to users

$ eina_modinfo module.so
 version: 0.1
 description:   Entry test
 license: GPLv2
 author:  Enlightenment Community

@feature

Reviewers: cedric, tasn, raster, jpeg

Subscribers: seoz

Differential Revision: https://phab.enlightenment.org/D4257
2016-08-31 16:17:53 +05:30
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
Stefan Schmidt 00227b81f4 build: do not dist now longer available files
Another cleanup for commit dd1d3f0d2d. These
makefiles are now longer available better not try to dist them.
2016-08-02 08:32:13 +02:00
Cedric BAIL e546fb767b eina: add forgotten file for distcheck. 2016-06-10 14:53:36 -07:00
Cedric BAIL edc753d1a2 eina: add tests suite for Eina_Safepointer. 2016-06-10 14:09:41 -07: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
Stefan Schmidt 93eadd76d6 build: split EXTRA_DIST files in src/ off from DISTFILES and handle separately
This is again to avoid the "Argument list too long" error we are hitting more and
more now. Given we just merged elementary, emotion generic players, evas generic
loaders and elm_code it is not surprising we are hitting it again.

This time the number of files being hold in DISTFILES has just grown to big so a
make dist was no longer possible. If one looks at what the DISTFILES variable
from automake holds you can image it grows a lot with all the source files plus
generated files we have in tree now.

DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)

To cut off a big chunk but still keep all the other automagic in place for
SOURCE files I went and renamed the EXTRA_DIST in src/ to EXTRA_DIST2 and handle
the files in a dist-hook now.

Another thing to note here is that this also only happens as we have the one big
Makefile with includes. If we go back to per directory Makefiles this problem
should vanish as well. In any case we need a solution for 1.18 now and this is
what I have to offer. If you have a cleaner solution in mind feel welcome to
test it out and if everything we need keeps working (make, make examples,
make check, make benchmark, make dist and make distcheck) go ahead.
2016-06-10 13:04:18 +02:00
Cedric Bail fdaedf2bff autotools: fix make distcheck. 2016-04-15 11:07:02 -07:00
Felipe Magno de Almeida 1d314828f7 eina: add tests for promises 2016-04-05 11:35:12 -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
Stefan Schmidt 96bb964dd5 Revert "eina: split Makefile with files/headers in preparation for additional per sub directory compilation"
This reverts commit 7f4ea1a79c.

This reverts one of three parts of the try to get sub directory
compilation back into eina. It breaks our distcheck though and I
talked to Cedric about it and he prefers to revert these as we might
need to go another route to bring this functionality back. Details
will come to the mailing list.
2016-03-08 00:18:08 +01:00
Stefan Schmidt c55625aec4 Revert "eina: rely on GNU make to find file at their correct location."
This reverts commit e26fcbb1dc.

This reverts one of three parts of the try to get sub directory
compilation back into eina. It breaks our distcheck though and I
talked to Cedric about it and he prefers to revert these as we might
need to go another route to bring this functionality back. Details
will come to the mailing list.
2016-03-08 00:18:08 +01:00
Cedric Bail e26fcbb1dc eina: rely on GNU make to find file at their correct location. 2016-03-03 21:10:00 -08:00
Cedric Bail 7f4ea1a79c eina: split Makefile with files/headers in preparation for additional per sub directory compilation 2016-03-03 15:10:59 -08:00
Vincent Torri ddf723e15b Add efl_check.h to eina unit test files as Eina is mandatory 2016-02-16 12:41:06 +00:00
se.osadchy 9e00bd01a1 eina: add test case for eina_vector2
Summary: Create eina_test_vector and add first test case.

Reviewers: cedric, stefan_schmidt

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3560
2016-01-13 13:46:49 +01: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
Jean-Philippe Andre dd05e72ab0 Eina Vector2: Move EAPI to static inline
This removes lots of unnecessary symbols
2016-01-07 18:05:44 +09:00
se.osadchy 2127547cb9 evas: create Eina_Vector2 structure and add functions.
Summary: Only copy code from evas_3d_utils, rename evas to eina and add documentation.

Reviewers: Hermet, raster, jpeg, cedric

Reviewed By: jpeg, cedric

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-01-04 15:06:00 -08:00
Vincent Torri 47ed848a87 Evil: integrate the dlfcn code into Evil
This will remove some incompatibilities with other packages,
especially for win-builds
2015-12-29 22:13:58 +09:00
Vincent Torri 33227fc15d eina: add API to join pahs, as well as path separators
eina_str_join() is used a lot to contatenate paths, but the
separator should be '\' on Windows. So add 2 API and 2 defines for
more cross platform code

@feature

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-21 17:10:29 +02:00
Subhransu Mohanty 6afb497d91 eina: add test for Eina_Bezier. 2015-08-07 14:33:52 +02:00
Subhransu Mohanty ddb8515930 eina: add Eina_Bezier infrastructure for manipulating cubic bezier curves. 2015-08-07 14:33:52 +02:00
Cedric BAIL a07c526460 eina: add intermediate inline function for eina_crc.
This is necessary to make my life easier when adding assembling implementation
of eina_crc.
2015-08-03 11:51:22 +02:00
Cedric BAIL 0acf23857f eina: beginning of a generic quaternion API. 2015-05-29 17:20:29 +02:00
Cedric BAIL 9a83100a4a eina: add the beginning of an Eina_Matrix4 API. 2015-05-29 17:20:28 +02:00
Vivek Ellur 331068b84a eina: add test cases for various APIs in eina_quad module.
Summary:
Added test cases for all the APIs in einq_quad module

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-27 00:31:06 +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
Vincent Torri 44d151c4da autotools: cleanup Makefile_Eina.am.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-14 18:41:47 +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
Carsten Haitzler 664708b817 eina - start a much improved eina dbug infra and have eina_log use it
this makes eina_log give bt's for all error logs. this is very useful
in finding just where a problem happens. the problem int he past is
that these have not been too useful due to backtrace_symbols() being
"useless". thus use the eina_btlog tool i added too.

also started infra for a debug monitor that can use the backtrace
infra to collect runtime stats ANY TIME for a process (don't need to
run under a debugger).

@feat
2015-05-08 14:13:17 +09:00
Stefan Schmidt d48c5accea Revert "autotools: enable make check per individual modules."
This reverts commit 35119e7bfd.

Reverted to bring make check back in a working state. Also the way we
want to handle a more modular testing needs discussion.
2015-05-07 20:50:56 +02:00
vivek 48dea34240 eina: add test case for eina_crc function in eina module.
Summary:
I added test cases using seed 0xffffffff, I was not
able to get crc value for different seeds online. Checked some of the links, but they are
using entirely different logic and value was not matching for other seed value.

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:09 +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
kabeer khan 35119e7bfd autotools: enable make check per individual modules.
Currently make check runs tests of whole EFL.Enabled running
of tests of individual modules by make check-<modulename>

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:07 +02:00
Cedric BAIL 32d614639f eina: in fact this is gone and won't come back.
Eo and Efl.Model are here for that task.
2015-04-29 09:47:58 +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
vivek a6b5ee94f0 eina: add test cases for eina_xattr functions.
Summary:
Add eina_test_xattr.c file for testing eina xattr functions and added test
cases for eina_xattr_set and eina_xattr_fd_set functions. Those tests need
a directory where the underlying file system allow xattr. Usually /tmp is
running on tmpfs that doesn't support today xattr. This test won't be run
if we are not provided with an existing proper directory.

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

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-06 20:19:21 +01:00