* CopyPgbsonIntoMemoryContext can be used to copy a pgbson into a * long-lived memory context. */
| 1844 | * long-lived memory context. |
| 1845 | */ |
| 1846 | pgbson * |
| 1847 | CopyPgbsonIntoMemoryContext(const pgbson *document, MemoryContext context) |
| 1848 | { |
| 1849 | pgbson *copiedDoc = MemoryContextAlloc(context, VARSIZE_ANY(document)); |
| 1850 | memcpy(copiedDoc, document, VARSIZE_ANY(document)); |
| 1851 | |
| 1852 | return copiedDoc; |
| 1853 | } |
| 1854 | |
| 1855 | |
| 1856 | /* |
no outgoing calls
no test coverage detected