* nodeToBinaryStringFast - * returns a binary representation of the Node as a palloc'd string */
| 1949 | * returns a binary representation of the Node as a palloc'd string |
| 1950 | */ |
| 1951 | char * |
| 1952 | nodeToBinaryStringFast(void *obj, int *length) |
| 1953 | { |
| 1954 | StringInfoData str; |
| 1955 | int16 tg = (int16) 0xDEAD; |
| 1956 | |
| 1957 | /* see stringinfo.h for an explanation of this maneuver */ |
| 1958 | initStringInfoOfSize(&str, 4096); |
| 1959 | |
| 1960 | _outNode(&str, obj); |
| 1961 | |
| 1962 | /* Add something special at the end that we can check in readfast.c */ |
| 1963 | appendBinaryStringInfo(&str, (const char *)&tg, sizeof(int16)); |
| 1964 | |
| 1965 | *length = str.len; |
| 1966 | return str.data; |
| 1967 | } |
no test coverage detected