\hypertarget{group__Eina__Cow__Group}{}\doxysection{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.  


\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+BEGIN}}(Cow,  Read,  Write\+\_\+\+Type,  Write)
\begin{DoxyCompactList}\small\item\em Definition for the macro to setup a writeable pointer from a const one. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}{EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+END}}(Cow,  Read,  Write)
\begin{DoxyCompactList}\small\item\em Definition for the macro to close the writeable pointer. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{group__Eina__Cow__Group_ga8887961f1f87ede76b5b521f00fd6b33}{EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+END\+\_\+\+NOGC}}(Cow,  Read,  Write)
\begin{DoxyCompactList}\small\item\em Definition for the macro to close the writeable pointer without triggering the GC. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}\label{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}} 
typedef struct \+\_\+\+Eina\+\_\+\+Cow \mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}}
\begin{DoxyCompactList}\small\item\em Type for Eina\+\_\+\+Cow pool. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}\label{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}} 
typedef void \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}}
\begin{DoxyCompactList}\small\item\em Type of the returned pointer to simplify some reading. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$ \mbox{\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, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} gc)
\begin{DoxyCompactList}\small\item\em Instantiates a new Eina\+\_\+\+Cow pool. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Cow__Group_gad15dd102a5d772b6e66ca444cdc0bec9}{eina\+\_\+cow\+\_\+del}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow)
\begin{DoxyCompactList}\small\item\em Destroys an Eina\+\_\+\+Cow pool and all the allocated memory. \end{DoxyCompactList}\item 
const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$ \mbox{\hyperlink{group__Eina__Cow__Group_gae919c98b8c3ce2561ea64c1572f0e554}{eina\+\_\+cow\+\_\+alloc}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow)
\begin{DoxyCompactList}\small\item\em Returns an initialized pointer from the pool. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Cow__Group_gaa5b1b9c8ef2432972d07feb93f8f4d9e}{eina\+\_\+cow\+\_\+free}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow, const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$$\ast$data)
\begin{DoxyCompactList}\small\item\em Frees a pointer from the pool. \end{DoxyCompactList}\item 
void $\ast$ \mbox{\hyperlink{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}{eina\+\_\+cow\+\_\+write}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow, const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$const $\ast$src)
\begin{DoxyCompactList}\small\item\em Gets a writeable pointer from a const pointer. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}{eina\+\_\+cow\+\_\+done}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow, const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$const $\ast$dst, const void $\ast$data, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} needed\+\_\+gc)
\begin{DoxyCompactList}\small\item\em Sets back a pointer into read only. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{group__Eina__Cow__Group_ga1e995db2ddb6c2d9e6bb27f402061a09}{eina\+\_\+cow\+\_\+memcpy}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow, const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$const $\ast$dst, const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$src)
\begin{DoxyCompactList}\small\item\em Makes the destination contain the same thing as the source pointer. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eina__Cow__Group_ga02a66f2700711233b420f8aa4e621a39}{eina\+\_\+cow\+\_\+gc}} (\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$cow)
\begin{DoxyCompactList}\small\item\em Tries to find entries that have the same content and update them. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
These functions provide some helper for a pseudo Copy-\/\+On-\/\+Write mechanism. 

Eina\+\_\+\+Cow will return a 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 pointers.

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


\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}\label{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}} 
\index{Copy On Write@{Copy On Write}!EINA\_COW\_WRITE\_BEGIN@{EINA\_COW\_WRITE\_BEGIN}}
\index{EINA\_COW\_WRITE\_BEGIN@{EINA\_COW\_WRITE\_BEGIN}!Copy On Write@{Copy On Write}}
\doxysubsubsection{\texorpdfstring{EINA\_COW\_WRITE\_BEGIN}{EINA\_COW\_WRITE\_BEGIN}}
{\footnotesize\ttfamily \#define EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+BEGIN(\begin{DoxyParamCaption}\item[{}]{Cow,  }\item[{}]{Read,  }\item[{}]{Write\+\_\+\+Type,  }\item[{}]{Write }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do}                                                                    \(\backslash\)}
\DoxyCodeLine{    \{                                                                   \(\backslash\)}
\DoxyCodeLine{      Write\_Type *Write;                                                \(\backslash\)}
\DoxyCodeLine{                                                                        \(\backslash\)}
\DoxyCodeLine{      Write = \mbox{\hyperlink{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}{eina\_cow\_write}}(Cow, ((\textcolor{keyword}{const} \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\_Cow\_Data}}**)\&(Read)));}

\end{DoxyCode}


Definition for the macro to setup a writeable pointer from a const one. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em Cow} & The Eina\+\_\+\+Cow where the const pointer came from. \\
\hline
\mbox{\texttt{ in}}  & {\em Read} & The const pointer to get a writable handler from. \\
\hline
\mbox{\texttt{ in}}  & {\em Write\+\_\+\+Type} & The type of the pointer you want to write to. \\
\hline
\mbox{\texttt{ in}}  & {\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}
\begin{DoxyNote}{Note}
This macro opens a C scope that is expected to be closed by \mbox{\hyperlink{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}{EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+END()}}. 
\end{DoxyNote}
\mbox{\Hypertarget{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}\label{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}} 
\index{Copy On Write@{Copy On Write}!EINA\_COW\_WRITE\_END@{EINA\_COW\_WRITE\_END}}
\index{EINA\_COW\_WRITE\_END@{EINA\_COW\_WRITE\_END}!Copy On Write@{Copy On Write}}
\doxysubsubsection{\texorpdfstring{EINA\_COW\_WRITE\_END}{EINA\_COW\_WRITE\_END}}
{\footnotesize\ttfamily \#define EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+END(\begin{DoxyParamCaption}\item[{}]{Cow,  }\item[{}]{Read,  }\item[{}]{Write }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{      \mbox{\hyperlink{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}{eina\_cow\_done}}(Cow, ((\textcolor{keyword}{const} \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\_Cow\_Data}}**)\&(Read)), Write,     \(\backslash\)}
\DoxyCodeLine{                    \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});                                                \(\backslash\)}
\DoxyCodeLine{    \}                                                                   \(\backslash\)}
\DoxyCodeLine{  while (0);}

\end{DoxyCode}


Definition for the macro to close the writeable pointer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em Cow} & The Eina\+\_\+\+Cow where the const pointer came from. \\
\hline
\mbox{\texttt{ in}}  & {\em Read} & The const pointer to get a writable handler from. \\
\hline
\mbox{\texttt{ in}}  & {\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}
\begin{DoxyNote}{Note}
This macro closes the scope opened by \mbox{\hyperlink{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+BEGIN()}}. 
\end{DoxyNote}
\mbox{\Hypertarget{group__Eina__Cow__Group_ga8887961f1f87ede76b5b521f00fd6b33}\label{group__Eina__Cow__Group_ga8887961f1f87ede76b5b521f00fd6b33}} 
\index{Copy On Write@{Copy On Write}!EINA\_COW\_WRITE\_END\_NOGC@{EINA\_COW\_WRITE\_END\_NOGC}}
\index{EINA\_COW\_WRITE\_END\_NOGC@{EINA\_COW\_WRITE\_END\_NOGC}!Copy On Write@{Copy On Write}}
\doxysubsubsection{\texorpdfstring{EINA\_COW\_WRITE\_END\_NOGC}{EINA\_COW\_WRITE\_END\_NOGC}}
{\footnotesize\ttfamily \#define EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+END\+\_\+\+NOGC(\begin{DoxyParamCaption}\item[{}]{Cow,  }\item[{}]{Read,  }\item[{}]{Write }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{      \mbox{\hyperlink{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}{eina\_cow\_done}}(Cow, ((\textcolor{keyword}{const} \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\_Cow\_Data}}**)\&(Read)), Write,     \(\backslash\)}
\DoxyCodeLine{                    \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});                                        \(\backslash\)}
\DoxyCodeLine{    \}                                                                   \(\backslash\)}
\DoxyCodeLine{  while (0);}

\end{DoxyCode}


Definition for the macro to close the writeable pointer without triggering the GC. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em Cow} & The Eina\+\_\+\+Cow where the const pointer came from. \\
\hline
\mbox{\texttt{ in}}  & {\em Read} & The const pointer to get a writable handler from. \\
\hline
\mbox{\texttt{ in}}  & {\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}
\begin{DoxyNote}{Note}
This macro closes the scope opened by \mbox{\hyperlink{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{EINA\+\_\+\+COW\+\_\+\+WRITE\+\_\+\+BEGIN()}}. 
\end{DoxyNote}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eina__Cow__Group_ga048bfc30136140591ccf031d32605f74}\label{group__Eina__Cow__Group_ga048bfc30136140591ccf031d32605f74}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_add()}{eina\_cow\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{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[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}}}]{gc }\end{DoxyParamCaption})}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em name} & The name of this pool, used for debugging. \\
\hline
\mbox{\texttt{ in}}  & {\em struct\+\_\+size} & The size of the object from this pool. \\
\hline
\mbox{\texttt{ in}}  & {\em step} & How many objects to allocate when the pool gets empty. \\
\hline
\mbox{\texttt{ in}}  & {\em default\+\_\+value} & The default value returned by this pool. \\
\hline
\mbox{\texttt{ in}}  & {\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 NULL} on error. 
\end{DoxyReturn}


References eina\+\_\+hash\+\_\+new(), eina\+\_\+hash\+\_\+pointer\+\_\+new(), EINA\+\_\+\+MAGIC\+\_\+\+SET, eina\+\_\+mempool\+\_\+add(), eina\+\_\+mempool\+\_\+alignof(), EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL, EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL, ERR, and INF.

\mbox{\Hypertarget{group__Eina__Cow__Group_gad15dd102a5d772b6e66ca444cdc0bec9}\label{group__Eina__Cow__Group_gad15dd102a5d772b6e66ca444cdc0bec9}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_del()}{eina\_cow\_del()}}
{\footnotesize\ttfamily void eina\+\_\+cow\+\_\+del (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow }\end{DoxyParamCaption})}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cow} & The pool to destroy \\
\hline
\end{DoxyParams}


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



Referenced by evas\+\_\+shutdown().

\mbox{\Hypertarget{group__Eina__Cow__Group_gae919c98b8c3ce2561ea64c1572f0e554}\label{group__Eina__Cow__Group_gae919c98b8c3ce2561ea64c1572f0e554}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_alloc()}{eina\_cow\_alloc()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}}$\ast$ eina\+\_\+cow\+\_\+alloc (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow }\end{DoxyParamCaption})}



Returns an initialized pointer from the pool. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em cow} & The pool to take things from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the new pool instance 
\end{DoxyReturn}
\mbox{\Hypertarget{group__Eina__Cow__Group_gaa5b1b9c8ef2432972d07feb93f8f4d9e}\label{group__Eina__Cow__Group_gaa5b1b9c8ef2432972d07feb93f8f4d9e}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_free()}{eina\_cow\_free()}}
{\footnotesize\ttfamily void eina\+\_\+cow\+\_\+free (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow,  }\item[{const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$$\ast$}]{data }\end{DoxyParamCaption})}



Frees a pointer from the pool. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em cow} & The pool to gave back memory to. \\
\hline
\mbox{\texttt{ in}}  & {\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 EINA\+\_\+\+MAGIC\+\_\+\+NONE, EINA\+\_\+\+MAGIC\+\_\+\+SET, and eina\+\_\+mempool\+\_\+free().



Referenced by eina\+\_\+cow\+\_\+memcpy().

\mbox{\Hypertarget{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}\label{group__Eina__Cow__Group_gad3e49fd11f3cb36e2bd8958b5be8fab0}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_write()}{eina\_cow\_write()}}
{\footnotesize\ttfamily void$\ast$ eina\+\_\+cow\+\_\+write (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow,  }\item[{const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$const $\ast$}]{src }\end{DoxyParamCaption})}



Gets a writeable pointer from a const pointer. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em cow} & The pool the pointer came from. \\
\hline
\mbox{\texttt{ in}}  & {\em src} & The pointer you want to write to.\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
This function is not thread safe. 
\end{DoxyNote}


References EINA\+\_\+\+FALSE, EINA\+\_\+\+MAGIC\+\_\+\+SET, eina\+\_\+mempool\+\_\+malloc(), and ERR.

\mbox{\Hypertarget{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}\label{group__Eina__Cow__Group_ga53993db46845b54e1a6874f04514029e}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_done()}{eina\_cow\_done()}}
{\footnotesize\ttfamily void eina\+\_\+cow\+\_\+done (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow,  }\item[{const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$const $\ast$}]{dst,  }\item[{const void $\ast$}]{data,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}}}]{needed\+\_\+gc }\end{DoxyParamCaption})}



Sets back a pointer into read only. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em cow} & The pool the pointer came from. \\
\hline
\mbox{\texttt{ in}}  & {\em dst} & The read only version of the pointer. \\
\hline
\mbox{\texttt{ in}}  & {\em data} & The pointer to which data was written to. \\
\hline
\mbox{\texttt{ in}}  & {\em needed\+\_\+gc} & Does this pool need to be garbage collected?\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
This function is not thread safe. 
\end{DoxyNote}


References ERR.

\mbox{\Hypertarget{group__Eina__Cow__Group_ga1e995db2ddb6c2d9e6bb27f402061a09}\label{group__Eina__Cow__Group_ga1e995db2ddb6c2d9e6bb27f402061a09}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_memcpy()}{eina\_cow\_memcpy()}}
{\footnotesize\ttfamily void eina\+\_\+cow\+\_\+memcpy (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow,  }\item[{const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$const $\ast$}]{dst,  }\item[{const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$}]{src }\end{DoxyParamCaption})}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em cow} & The pool the pointers came from. \\
\hline
\mbox{\texttt{ in}}  & {\em dst} & The destination to update. \\
\hline
\mbox{\texttt{ in}}  & {\em src} & The source of information to copy. \\
\hline
\end{DoxyParams}


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

\mbox{\Hypertarget{group__Eina__Cow__Group_ga02a66f2700711233b420f8aa4e621a39}\label{group__Eina__Cow__Group_ga02a66f2700711233b420f8aa4e621a39}} 
\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}}
\doxysubsubsection{\texorpdfstring{eina\_cow\_gc()}{eina\_cow\_gc()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eina\+\_\+cow\+\_\+gc (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$}]{cow }\end{DoxyParamCaption})}



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


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in,out}}  & {\em cow} & The cow to try to compact. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
EINA\+\_\+\+TRUE if something was compacted, EINA\+\_\+\+FALSE 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 matches and merge them into one pointer. 

References EINA\+\_\+\+FALSE, eina\+\_\+hash\+\_\+iterator\+\_\+data\+\_\+new(), eina\+\_\+hash\+\_\+population(), eina\+\_\+iterator\+\_\+free(), eina\+\_\+iterator\+\_\+next(), and EINA\+\_\+\+TRUE.

