Create a new empty zipmap. */
| 94 | |
| 95 | /* Create a new empty zipmap. */ |
| 96 | unsigned char *zipmapNew(void) { |
| 97 | unsigned char *zm = zmalloc(2, MALLOC_SHARED); |
| 98 | |
| 99 | zm[0] = 0; /* Length */ |
| 100 | zm[1] = ZIPMAP_END; |
| 101 | return zm; |
| 102 | } |
| 103 | |
| 104 | /* Decode the encoded length pointed by 'p' */ |
| 105 | static unsigned int zipmapDecodeLength(unsigned char *p) { |