| if(n < 256 || n > VtMaxLumpSize) { |
| werrstr("bad block size"); |
| vtentrypack(VtEntry *e, uchar *p, int index) |
| p += index * VtEntrySize; |
| depth = e->type&VtTypeDepthMask; |
| flags = (e->flags&~(_VtEntryDir|_VtEntryDepthMask)); |
| flags |= depth << _VtEntryDepthShift; |
| if(e->type - depth == VtDirType) |
| memmove(p, e->score, VtScoreSize); |
| assert(p-op == VtEntrySize); |
| vtentryunpack(VtEntry *e, uchar *p, int index) |
| p += index * VtEntrySize; |
| e->type = (e->flags&_VtEntryDir) ? VtDirType : VtDataType; |
| e->type += (e->flags & _VtEntryDepthMask) >> _VtEntryDepthShift; |
| e->flags &= ~(_VtEntryDir|_VtEntryDepthMask); |
| memmove(e->score, p, VtScoreSize); |
| assert(p-op == VtEntrySize); |
| if(!(e->flags & VtEntryActive)) |
| if(checksize(e->psize) < 0 || checksize(e->dsize) < 0) |