\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 {\bfseries 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 {\bfseries 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__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \mbox{\hyperlink{group__Eina__Cow__Group_ga0e928b81958e7fe17f210629fad15a24}{Eina\+\_\+\+Cow}} $\ast$ \mbox{\hyperlink{group__Eina__Cow__Group_ga0c55f4406fbf96dca46de08719413153}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Cow__Group_gad03c0e15e2c7c9f539e3d3331cb74570}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} const \mbox{\hyperlink{group__Eina__Cow__Group_ga854ebe0e23513188f43adfdc6b4e977f}{Eina\+\_\+\+Cow\+\_\+\+Data}} $\ast$ \mbox{\hyperlink{group__Eina__Cow__Group_ga42fa3acebd6f1c2bd1ae3dc88e866d8f}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Cow__Group_ga3df9e39789e2ca83302230b97e486931}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void $\ast$ \mbox{\hyperlink{group__Eina__Cow__Group_ga0b9fdfa65d7b65bb6f0dca5a8fd49b79}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Cow__Group_ga64e5caef3dbb8cbf4168593692a5c54c}{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 
\mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} void \mbox{\hyperlink{group__Eina__Cow__Group_ga1f38b4b67b97d37499dbbef7efe26c57}{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_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eina__Cow__Group_ga66610ae59e2d5cf8fb258f3d2625c53d}{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_ga0b9fdfa65d7b65bb6f0dca5a8fd49b79}{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_ga64e5caef3dbb8cbf4168593692a5c54c}{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_ga64e5caef3dbb8cbf4168593692a5c54c}{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_ga0c55f4406fbf96dca46de08719413153}\label{group__Eina__Cow__Group_ga0c55f4406fbf96dca46de08719413153}} 
\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__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \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 \mbox{\hyperlink{group__Eina__Hash__Group_ga8676c1d28a50581fc4c04d5c3092eacb}{eina\+\_\+hash\+\_\+new()}}, \mbox{\hyperlink{group__Eina__Hash__Group_gaa1a3ef16d0247ba9a05648c16ccb3da6}{eina\+\_\+hash\+\_\+pointer\+\_\+new()}}, \mbox{\hyperlink{group__Eina__Magic__Group_ga470f5ce28eaaf59ce80523be8471c5e0}{EINA\+\_\+\+MAGIC\+\_\+\+SET}}, \mbox{\hyperlink{group__Eina__Memory__Pool__Group_ga2b67a4285f612a2ed4767177f865f095}{eina\+\_\+mempool\+\_\+add()}}, \mbox{\hyperlink{group__Eina__Memory__Pool__Group_gaf91146872014f8a8df3abe29b83356fe}{eina\+\_\+mempool\+\_\+alignof()}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gae7cf7b1d66fa9022242e09fd53c06bb2}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+FALSE\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}.



Referenced by \mbox{\hyperlink{group__Edje__General__Group_ga1c9c6594f38023c29fbfb2d0c8c675db}{edje\+\_\+init()}}.

\mbox{\Hypertarget{group__Eina__Cow__Group_gad03c0e15e2c7c9f539e3d3331cb74570}\label{group__Eina__Cow__Group_gad03c0e15e2c7c9f539e3d3331cb74570}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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 \mbox{\hyperlink{group__Eina__Hash__Group_ga76829f09c99852b1536efc813d99fc78}{eina\+\_\+hash\+\_\+free()}}, and \mbox{\hyperlink{group__Eina__Memory__Pool__Group_gaca341af7df37485e3d8ed42e011b2aab}{eina\+\_\+mempool\+\_\+del()}}.



Referenced by \mbox{\hyperlink{group__Edje__General__Group_ga1c9c6594f38023c29fbfb2d0c8c675db}{edje\+\_\+init()}}, and \mbox{\hyperlink{group__Evas__Main__Group_gadb9d1c9f3fcff94cea89e12942c40919}{evas\+\_\+shutdown()}}.

\mbox{\Hypertarget{group__Eina__Cow__Group_ga42fa3acebd6f1c2bd1ae3dc88e866d8f}\label{group__Eina__Cow__Group_ga42fa3acebd6f1c2bd1ae3dc88e866d8f}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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_ga3df9e39789e2ca83302230b97e486931}\label{group__Eina__Cow__Group_ga3df9e39789e2ca83302230b97e486931}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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 \mbox{\hyperlink{group__Eina__Magic__Group_ga087a0d5a1e482da550b33fe4fcb0435f}{EINA\+\_\+\+MAGIC\+\_\+\+NONE}}, and \mbox{\hyperlink{group__Eina__Magic__Group_ga470f5ce28eaaf59ce80523be8471c5e0}{EINA\+\_\+\+MAGIC\+\_\+\+SET}}.



Referenced by \mbox{\hyperlink{group__Eina__Cow__Group_ga1f38b4b67b97d37499dbbef7efe26c57}{eina\+\_\+cow\+\_\+memcpy()}}.

\mbox{\Hypertarget{group__Eina__Cow__Group_ga0b9fdfa65d7b65bb6f0dca5a8fd49b79}\label{group__Eina__Cow__Group_ga0b9fdfa65d7b65bb6f0dca5a8fd49b79}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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 \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, and \mbox{\hyperlink{group__Eina__Magic__Group_ga470f5ce28eaaf59ce80523be8471c5e0}{EINA\+\_\+\+MAGIC\+\_\+\+SET}}.

\mbox{\Hypertarget{group__Eina__Cow__Group_ga64e5caef3dbb8cbf4168593692a5c54c}\label{group__Eina__Cow__Group_ga64e5caef3dbb8cbf4168593692a5c54c}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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}
\mbox{\Hypertarget{group__Eina__Cow__Group_ga1f38b4b67b97d37499dbbef7efe26c57}\label{group__Eina__Cow__Group_ga1f38b4b67b97d37499dbbef7efe26c57}} 
\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 \mbox{\hyperlink{group__Eina__Types__Group_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} 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 \mbox{\hyperlink{group__Eina__Cow__Group_ga3df9e39789e2ca83302230b97e486931}{eina\+\_\+cow\+\_\+free()}}.

\mbox{\Hypertarget{group__Eina__Cow__Group_ga66610ae59e2d5cf8fb258f3d2625c53d}\label{group__Eina__Cow__Group_ga66610ae59e2d5cf8fb258f3d2625c53d}} 
\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_ga6ac08753ba12bc9c7a0390cf67868f4f}{EINA\+\_\+\+API}} \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 \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Hash__Group_ga1fa6b5d170d65706416bfb1446d7b1b8}{eina\+\_\+hash\+\_\+iterator\+\_\+data\+\_\+new()}}, \mbox{\hyperlink{group__Eina__Hash__Group_ga4bdeb2a1699703c62db697f229efe32d}{eina\+\_\+hash\+\_\+population()}}, \mbox{\hyperlink{group__Eina__Iterator__Group_ga50da005e8d26c0a043d0d1c025bc9008}{eina\+\_\+iterator\+\_\+free()}}, \mbox{\hyperlink{group__Eina__Iterator__Group_gad870f9b1d5fb8892cb9623ad0e7f75b2}{eina\+\_\+iterator\+\_\+next()}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

