\hypertarget{group__Eina__Cow__Group}{}\section{Copy On Write}
\label{group__Eina__Cow__Group}\index{Copy On Write@{Copy On Write}}


These functions provide some helper for a pseudo Copy On Write mechanism.  


\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN}(Cow,  Read,  Write\+\_\+\+Type,  Write)
\begin{DoxyCompactList}\small\item\em This macro setup a writable pointer from a const one. \end{DoxyCompactList}\item 
\#define \hyperlink{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND}(Cow,  Read,  Write)
\begin{DoxyCompactList}\small\item\em This macro close the writable pointer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \+\_\+\+Eina\+\_\+\+Cow \hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}\hypertarget{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{}\label{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}

\begin{DoxyCompactList}\small\item\em Type for Eina\+\_\+\+Cow pool. \end{DoxyCompactList}\item 
typedef void \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}\hypertarget{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{}\label{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}

\begin{DoxyCompactList}\small\item\em Type of the returned pointer to simplify some reading. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$ \hyperlink{group__Eina__Cow__Group_ga048bfc30136140591ccf031d32605f74}{eina\+\_\+cow\+\_\+add} (const char $\ast$name, unsigned int struct\+\_\+size, unsigned int step, const void $\ast$default\+\_\+value, \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} gc)
\begin{DoxyCompactList}\small\item\em Instantiate a new Eina\+\_\+\+Cow pool. \end{DoxyCompactList}\item 
void \hyperlink{group__Eina__Cow__Group_gad15dd102a5d772b6e66ca444cdc0bec9}{eina\+\_\+cow\+\_\+del} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow)
\begin{DoxyCompactList}\small\item\em Destroy an Eina\+\_\+\+Cow pool and all the allocated memory. \end{DoxyCompactList}\item 
const \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$ \hyperlink{group__Eina__Cow__Group_gae919c98b8c3ce2561ea64c1572f0e554}{eina\+\_\+cow\+\_\+alloc} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow)
\begin{DoxyCompactList}\small\item\em Return an initialized pointer from the pool. \end{DoxyCompactList}\item 
void \hyperlink{group__Eina__Cow__Group_gaa5b1b9c8ef2432972d07feb93f8f4d9e}{eina\+\_\+cow\+\_\+free} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow, const \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$$\ast$data)
\begin{DoxyCompactList}\small\item\em Free a pointer from the pool. \end{DoxyCompactList}\item 
void $\ast$ \hyperlink{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}{eina\+\_\+cow\+\_\+write} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow, const \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$const $\ast$src)
\begin{DoxyCompactList}\small\item\em Get a writable pointer from a const pointer. \end{DoxyCompactList}\item 
void \hyperlink{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}{eina\+\_\+cow\+\_\+done} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow, const \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$const $\ast$dst, const void $\ast$data, \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} needed\+\_\+gc)
\begin{DoxyCompactList}\small\item\em Set back a pointer into read only. \end{DoxyCompactList}\item 
void \hyperlink{group__Eina__Cow__Group_ga1e995db2ddb6c2d9e6bb27f402061a09}{eina\+\_\+cow\+\_\+memcpy} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow, const \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$const $\ast$dst, const \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$src)
\begin{DoxyCompactList}\small\item\em Make the destination contain the same thing as the source pointer. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eina__Cow__Group_ga02a66f2700711233b420f8aa4e621a39}{eina\+\_\+cow\+\_\+gc} (\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow} $\ast$cow)
\begin{DoxyCompactList}\small\item\em Try to find entries that have the same content and update them. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
These functions provide some helper for a pseudo Copy On Write mechanism. 

Eina\+\_\+\+Cow will return const memory pointer to some default value that you will be able to change only by requesting a writable pointer. Later on a garbage collector can come online and try to merge back some of those pointer.

\begin{DoxySince}{Since}
1.\+8.\+0 
\end{DoxySince}


\subsection{Macro Definition Documentation}
\index{Copy On Write@{Copy On Write}!E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN@{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN}}
\index{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN@{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN}{EINA_COW_WRITE_BEGIN}}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+IN(
\begin{DoxyParamCaption}
\item[{}]{Cow, }
\item[{}]{Read, }
\item[{}]{Write\+\_\+\+Type, }
\item[{}]{Write}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{}\label{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}
{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do}                                                                      \(\backslash\)
    \{                                                                   \(\backslash\)
      Write\_Type *Write;                                                \(\backslash\)
                                                                        \(\backslash\)
      Write = \hyperlink{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}{eina\_cow\_write}(Cow, ((\textcolor{keyword}{const} \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\_Cow\_Data}**)&(Read)));
\end{DoxyCode}


This macro setup a writable pointer from a const one. 


\begin{DoxyParams}{Parameters}
{\em Cow} & The Eina\+\_\+\+Cow where the const pointer come from. \\
\hline
{\em Read} & The const pointer to get a writable handler from. \\
\hline
{\em Write\+\_\+\+Type} & The type of the pointer you want to write to. \\
\hline
{\em Write} & The name of the variable where to put the writeable pointer to. \\
\hline
\end{DoxyParams}
\begin{DoxySince}{Since}
1.\+8.\+0
\end{DoxySince}
Be careful this macro opens a C scope that is expected to be closed by \hyperlink{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+N\+D()}. 

Referenced by evas\+\_\+map\+\_\+util\+\_\+clockwise\+\_\+get(), evas\+\_\+object\+\_\+del(), evas\+\_\+object\+\_\+image\+\_\+alpha\+\_\+mask\+\_\+set(), evas\+\_\+object\+\_\+image\+\_\+memfile\+\_\+set(), evas\+\_\+object\+\_\+image\+\_\+reload(), evas\+\_\+object\+\_\+image\+\_\+size\+\_\+set(), evas\+\_\+object\+\_\+image\+\_\+source\+\_\+unset(), evas\+\_\+object\+\_\+visible\+\_\+get(), and evas\+\_\+render\+\_\+updates\+\_\+free().

\index{Copy On Write@{Copy On Write}!E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND@{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND}}
\index{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND@{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND}{EINA_COW_WRITE_END}}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+ND(
\begin{DoxyParamCaption}
\item[{}]{Cow, }
\item[{}]{Read, }
\item[{}]{Write}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}{}\label{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}
{\bfseries Value\+:}
\begin{DoxyCode}
\hyperlink{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}{eina\_cow\_done}(Cow, ((\textcolor{keyword}{const} \hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\_Cow\_Data}**)&(Read)), Write,   \(\backslash\)
                    \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE});                                                \(\backslash\)
    \}                                                                   \(\backslash\)
  while (0);
\end{DoxyCode}


This macro close the writable pointer. 


\begin{DoxyParams}{Parameters}
{\em Cow} & The Eina\+\_\+\+Cow where the const pointer come from. \\
\hline
{\em Read} & The const pointer to get a writable handler from. \\
\hline
{\em Write} & The name of the variable where to put the writeable pointer to. \\
\hline
\end{DoxyParams}
\begin{DoxySince}{Since}
1.\+8.\+0
\end{DoxySince}
Be careful this macro close the scope opened by \hyperlink{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+I\+N()}. 

Referenced by evas\+\_\+map\+\_\+util\+\_\+clockwise\+\_\+get(), evas\+\_\+object\+\_\+del(), evas\+\_\+object\+\_\+image\+\_\+alpha\+\_\+mask\+\_\+set(), evas\+\_\+object\+\_\+image\+\_\+memfile\+\_\+set(), evas\+\_\+object\+\_\+image\+\_\+reload(), evas\+\_\+object\+\_\+image\+\_\+size\+\_\+set(), evas\+\_\+object\+\_\+image\+\_\+source\+\_\+unset(), evas\+\_\+object\+\_\+visible\+\_\+get(), and evas\+\_\+render\+\_\+updates\+\_\+free().



\subsection{Function Documentation}
\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+add@{eina\+\_\+cow\+\_\+add}}
\index{eina\+\_\+cow\+\_\+add@{eina\+\_\+cow\+\_\+add}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+add(const char $\ast$name, unsigned int struct\+\_\+size, unsigned int step, const void $\ast$default\+\_\+value, Eina\+\_\+\+Bool gc)}{eina_cow_add(const char *name, unsigned int struct_size, unsigned int step, const void *default_value, Eina_Bool gc)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Eina\+\_\+\+Cow}$\ast$ eina\+\_\+cow\+\_\+add (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name, }
\item[{unsigned int}]{struct\+\_\+size, }
\item[{unsigned int}]{step, }
\item[{const void $\ast$}]{default\+\_\+value, }
\item[{{\bf Eina\+\_\+\+Bool}}]{gc}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_ga048bfc30136140591ccf031d32605f74}{}\label{group__Eina__Cow__Group_ga048bfc30136140591ccf031d32605f74}


Instantiate a new Eina\+\_\+\+Cow pool. 


\begin{DoxyParams}{Parameters}
{\em name} & The name of this pool, used for debug. \\
\hline
{\em struct\+\_\+size} & The size of the object from this pool. \\
\hline
{\em step} & How many objects to allocate when the pool gets empty. \\
\hline
{\em default\+\_\+value} & The default value returned by this pool. \\
\hline
{\em gc} & Is it possible to run garbage collection on this pool. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a valid new Eina\+\_\+\+Cow or {\ttfamily N\+U\+LL} on error. 
\end{DoxyReturn}


References eina\+\_\+hash\+\_\+new(), eina\+\_\+hash\+\_\+pointer\+\_\+new(), E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+ET, eina\+\_\+mempool\+\_\+add(), eina\+\_\+mempool\+\_\+alignof(), E\+RR, and I\+NF.



Referenced by edje\+\_\+init().

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+del@{eina\+\_\+cow\+\_\+del}}
\index{eina\+\_\+cow\+\_\+del@{eina\+\_\+cow\+\_\+del}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+del(\+Eina\+\_\+\+Cow $\ast$cow)}{eina_cow_del(Eina_Cow *cow)}}]{\setlength{\rightskip}{0pt plus 5cm}void eina\+\_\+cow\+\_\+del (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_gad15dd102a5d772b6e66ca444cdc0bec9}{}\label{group__Eina__Cow__Group_gad15dd102a5d772b6e66ca444cdc0bec9}


Destroy an Eina\+\_\+\+Cow pool and all the allocated memory. 


\begin{DoxyParams}{Parameters}
{\em cow} & The pool to destroy \\
\hline
\end{DoxyParams}


References eina\+\_\+hash\+\_\+free(), and eina\+\_\+mempool\+\_\+del().



Referenced by edje\+\_\+init(), and evas\+\_\+shutdown().

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+alloc@{eina\+\_\+cow\+\_\+alloc}}
\index{eina\+\_\+cow\+\_\+alloc@{eina\+\_\+cow\+\_\+alloc}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+alloc(\+Eina\+\_\+\+Cow $\ast$cow)}{eina_cow_alloc(Eina_Cow *cow)}}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Eina\+\_\+\+Cow\+\_\+\+Data}$\ast$ eina\+\_\+cow\+\_\+alloc (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_gae919c98b8c3ce2561ea64c1572f0e554}{}\label{group__Eina__Cow__Group_gae919c98b8c3ce2561ea64c1572f0e554}


Return an initialized pointer from the pool. 


\begin{DoxyParams}{Parameters}
{\em cow} & The pool to take things from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the new pool instance 
\end{DoxyReturn}


Referenced by edje\+\_\+file\+\_\+data\+\_\+get(), and edje\+\_\+transition\+\_\+duration\+\_\+factor\+\_\+set().

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+free@{eina\+\_\+cow\+\_\+free}}
\index{eina\+\_\+cow\+\_\+free@{eina\+\_\+cow\+\_\+free}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+free(\+Eina\+\_\+\+Cow $\ast$cow, const Eina\+\_\+\+Cow\+\_\+\+Data $\ast$$\ast$data)}{eina_cow_free(Eina_Cow *cow, const Eina_Cow_Data **data)}}]{\setlength{\rightskip}{0pt plus 5cm}void eina\+\_\+cow\+\_\+free (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow, }
\item[{const {\bf Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$$\ast$}]{data}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_gaa5b1b9c8ef2432972d07feb93f8f4d9e}{}\label{group__Eina__Cow__Group_gaa5b1b9c8ef2432972d07feb93f8f4d9e}


Free a pointer from the pool. 


\begin{DoxyParams}{Parameters}
{\em cow} & The pool to gave back memory to. \\
\hline
{\em data} & The data to give back.\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
To simplify the caller code $\ast$data will point to the default read only state after the call to this function. 
\end{DoxyNote}


References E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+N\+O\+NE, E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+ET, and eina\+\_\+mempool\+\_\+free().



Referenced by edje\+\_\+file\+\_\+data\+\_\+get(), edje\+\_\+transition\+\_\+duration\+\_\+factor\+\_\+set(), eina\+\_\+cow\+\_\+memcpy(), and evas\+\_\+object\+\_\+image\+\_\+alpha\+\_\+mask\+\_\+set().

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+write@{eina\+\_\+cow\+\_\+write}}
\index{eina\+\_\+cow\+\_\+write@{eina\+\_\+cow\+\_\+write}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+write(\+Eina\+\_\+\+Cow $\ast$cow, const Eina\+\_\+\+Cow\+\_\+\+Data $\ast$const $\ast$src)}{eina_cow_write(Eina_Cow *cow, const Eina_Cow_Data *const *src)}}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ eina\+\_\+cow\+\_\+write (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow, }
\item[{const {\bf Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$const $\ast$}]{src}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}{}\label{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}


Get a writable pointer from a const pointer. 


\begin{DoxyParams}{Parameters}
{\em cow} & The pool the pointer come from. \\
\hline
{\em src} & The pointer you want to write to.\\
\hline
\end{DoxyParams}
N\+O\+TE\+: this function is not thread safe, be careful. 

References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, E\+I\+N\+A\+\_\+\+M\+A\+G\+I\+C\+\_\+\+S\+ET, eina\+\_\+mempool\+\_\+malloc(), E\+I\+N\+A\+\_\+\+T\+R\+UE, and E\+RR.

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+done@{eina\+\_\+cow\+\_\+done}}
\index{eina\+\_\+cow\+\_\+done@{eina\+\_\+cow\+\_\+done}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+done(\+Eina\+\_\+\+Cow $\ast$cow, const Eina\+\_\+\+Cow\+\_\+\+Data $\ast$const $\ast$dst, const void $\ast$data, Eina\+\_\+\+Bool needed\+\_\+gc)}{eina_cow_done(Eina_Cow *cow, const Eina_Cow_Data *const *dst, const void *data, Eina_Bool needed_gc)}}]{\setlength{\rightskip}{0pt plus 5cm}void eina\+\_\+cow\+\_\+done (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow, }
\item[{const {\bf Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$const $\ast$}]{dst, }
\item[{const void $\ast$}]{data, }
\item[{{\bf Eina\+\_\+\+Bool}}]{needed\+\_\+gc}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}{}\label{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}


Set back a pointer into read only. 


\begin{DoxyParams}{Parameters}
{\em cow} & The pool the pointer come from. \\
\hline
{\em dst} & The read only version of the pointer. \\
\hline
{\em data} & The pointer to which data was written to. \\
\hline
{\em needed\+\_\+gc} & Does this pool need to be garbage collected?\\
\hline
\end{DoxyParams}
N\+O\+TE\+: this function is not thread safe, be careful. 

References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, and E\+RR.

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+memcpy@{eina\+\_\+cow\+\_\+memcpy}}
\index{eina\+\_\+cow\+\_\+memcpy@{eina\+\_\+cow\+\_\+memcpy}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+memcpy(\+Eina\+\_\+\+Cow $\ast$cow, const Eina\+\_\+\+Cow\+\_\+\+Data $\ast$const $\ast$dst, const Eina\+\_\+\+Cow\+\_\+\+Data $\ast$src)}{eina_cow_memcpy(Eina_Cow *cow, const Eina_Cow_Data *const *dst, const Eina_Cow_Data *src)}}]{\setlength{\rightskip}{0pt plus 5cm}void eina\+\_\+cow\+\_\+memcpy (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow, }
\item[{const {\bf Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$const $\ast$}]{dst, }
\item[{const {\bf Eina\+\_\+\+Cow\+\_\+\+Data} $\ast$}]{src}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_ga1e995db2ddb6c2d9e6bb27f402061a09}{}\label{group__Eina__Cow__Group_ga1e995db2ddb6c2d9e6bb27f402061a09}


Make the destination contain the same thing as the source pointer. 


\begin{DoxyParams}{Parameters}
{\em cow} & The pool the pointers come from. \\
\hline
{\em dst} & The destination to update. \\
\hline
{\em src} & The source of information to copy. \\
\hline
\end{DoxyParams}


References eina\+\_\+cow\+\_\+free().



Referenced by evas\+\_\+object\+\_\+image\+\_\+alpha\+\_\+mask\+\_\+set().

\index{Copy On Write@{Copy On Write}!eina\+\_\+cow\+\_\+gc@{eina\+\_\+cow\+\_\+gc}}
\index{eina\+\_\+cow\+\_\+gc@{eina\+\_\+cow\+\_\+gc}!Copy On Write@{Copy On Write}}
\subsubsection[{\texorpdfstring{eina\+\_\+cow\+\_\+gc(\+Eina\+\_\+\+Cow $\ast$cow)}{eina_cow_gc(Eina_Cow *cow)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Eina\+\_\+\+Bool} eina\+\_\+cow\+\_\+gc (
\begin{DoxyParamCaption}
\item[{{\bf Eina\+\_\+\+Cow} $\ast$}]{cow}
\end{DoxyParamCaption}
)}\hypertarget{group__Eina__Cow__Group_ga02a66f2700711233b420f8aa4e621a39}{}\label{group__Eina__Cow__Group_ga02a66f2700711233b420f8aa4e621a39}


Try to find entries that have the same content and update them. 


\begin{DoxyParams}{Parameters}
{\em cow} & The cow to try to compact. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+UE if something was compacted, E\+I\+N\+A\+\_\+\+F\+A\+L\+SE if nothing was.
\end{DoxyReturn}
There is no guaranty in the time it will require, but should remain low. It does run a hash function on all possible common structures trying to find the one that match and merge them into one pointer. 

References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, eina\+\_\+hash\+\_\+iterator\+\_\+data\+\_\+new(), eina\+\_\+hash\+\_\+population(), eina\+\_\+iterator\+\_\+free(), eina\+\_\+iterator\+\_\+next(), and E\+I\+N\+A\+\_\+\+T\+R\+UE.

