This group discusses the functions that allow you to store one copy of an object, and use it throughout your program. More...
Macros | |
| #define | eina_binshare_add(ptr) eina_binshare_add_length(ptr, sizeof(*ptr)) |
| Retrieves an instance of a blob for use in a program. More... | |
Functions | |
| EAPI const void * | eina_binshare_add_length (const void *obj, unsigned int olen) EINA_WARN_UNUSED_RESULT |
| Retrieves an instance of an object for use in a program. More... | |
| EAPI const void * | eina_binshare_ref (const void *obj) |
| Increments references of the given shared object. More... | |
| EAPI void | eina_binshare_del (const void *obj) |
| Notes that the given object has lost an instance. More... | |
| EAPI int | eina_binshare_length (const void *obj) EINA_WARN_UNUSED_RESULT EINA_PURE |
| Notes that the given object must be shared. More... | |
| EAPI void | eina_binshare_dump (void) |
| Dumps the contents of share_common. More... | |
This group discusses the functions that allow you to store one copy of an object, and use it throughout your program.
This is a method to reduce the number of duplicated objects kept in the memory.
For more information, you can look at the Binary Share Tutorial.
| #define eina_binshare_add | ( | ptr | ) | eina_binshare_add_length(ptr, sizeof(*ptr)) |
Retrieves an instance of a blob for use in a program.
This macro retrieves an instance of obj. If obj is NULL, then NULL is returned. If obj is already stored, it is just returned and its reference counter is increased. Otherwise it is added to the blobs to be searched and a duplicated blob of obj is returned.
| [in] | ptr | The binary blob to retrieve an instance of |
NULL on failure| EAPI const void* eina_binshare_add_length | ( | const void * | obj, |
| unsigned int | olen | ||
| ) |
Retrieves an instance of an object for use in a program.
| [in] | obj | The binary object to retrieve an instance of |
| [in] | olen | The byte size |
NULL on failureThis function retrieves an instance of obj. If obj is NULL, then NULL is returned. If obj is already stored, it is just returned and its reference counter is increased. Otherwise it is added to the objects to be searched and a duplicated object of obj is returned.
| EAPI const void* eina_binshare_ref | ( | const void * | obj | ) |
Increments references of the given shared object.
| [in] | obj | The shared object |
NULL on failure| EAPI void eina_binshare_del | ( | const void * | obj | ) |
Notes that the given object has lost an instance.
| [in] | obj | The given object |
This function decreases the reference counter associated to obj if it exists. If that counter reaches 0, the memory associated to obj is freed. If obj is NULL, the function returns immediately.
| EAPI int eina_binshare_length | ( | const void * | obj | ) |
Notes that the given object must be shared.
This function is a cheap way to know the length of a shared object.
| [in] | obj | The shared object to know the length It is safe to give NULL, in which case -1 is returned |
| EAPI void eina_binshare_dump | ( | void | ) |
Dumps the contents of share_common.
This function dumps all the objects from share_common to stdout with a DDD: prefix per line and a memory usage summary.