\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 \mbox{\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 Definition for the macro to setup a writeable pointer from a const one. \end{DoxyCompactList}\item 
\#define \mbox{\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 Definition for the macro to close the writeable pointer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{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}
\subsection*{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}


\subsection{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}


\subsection{Macro Definition Documentation}
\mbox{\Hypertarget{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}\label{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}} 
\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}}
{\footnotesize\ttfamily \#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})}

{\bfseries Value\+:}
\begin{DoxyCode}
\textcolor{keywordflow}{do}                                                                      \(\backslash\)
    \{                                                                   \(\backslash\)
      Write\_Type *Write;                                                \(\backslash\)
                                                                        \(\backslash\)
      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}{Parameters}
{\em Cow} & The Eina\+\_\+\+Cow where the const pointer came 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 \mbox{\hyperlink{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+E\+N\+D()}}. \mbox{\Hypertarget{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}\label{group__Eina__Cow__Group_ga534f63d0d61c6e9256488d211fc2a473}} 
\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}}
{\footnotesize\ttfamily \#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})}

{\bfseries Value\+:}
\begin{DoxyCode}
\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\)
                    \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});                                                \(\backslash\)
    \}                                                                   \(\backslash\)
  while (0);
\end{DoxyCode}


Definition for the macro to close the writeable pointer. 


\begin{DoxyParams}{Parameters}
{\em Cow} & The Eina\+\_\+\+Cow where the const pointer came 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 \mbox{\hyperlink{group__Eina__Cow__Group_ga1f0c8727aa196d1974b696f999cd0f10}{E\+I\+N\+A\+\_\+\+C\+O\+W\+\_\+\+W\+R\+I\+T\+E\+\_\+\+B\+E\+G\+I\+N()}}. 

\subsection{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}}
\subsubsection{\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}{Parameters}
{\em name} & The name of this pool, used for debugging. \\
\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}


Referenced by edje\+\_\+init(), and efl\+\_\+object\+\_\+init().

\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}}
\subsubsection{\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}{Parameters}
{\em cow} & The pool to destroy \\
\hline
\end{DoxyParams}


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

\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}}
\subsubsection{\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}{Parameters}
{\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}}
\subsubsection{\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}{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 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}}
\subsubsection{\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}{Parameters}
{\em cow} & The pool the pointer came 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.

\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}}
\subsubsection{\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}{Parameters}
{\em cow} & The pool the pointer came 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.

\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}}
\subsubsection{\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}{Parameters}
{\em cow} & The pool the pointers came from. \\
\hline
{\em dst} & The destination to update. \\
\hline
{\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}}
\subsubsection{\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}{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 matches 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.

