- /* consider next block pointer */
- if (last && i == ptr-1)
- mb[i+1].block = 0;
- else if (!mb[i+1].block)
- mb[i+1].block = isc_alloc_block (is, cat);
-
- /* write block */
- assert (mb[i+1].offset > mb[i].offset);
- isc_write_dblock (is, cat, mb[i].block, r_buf + mb[i].offset,
- mb[i+1].block, mb[i+1].offset - mb[i].offset);
+ memcpy (src+sizeof(int)+sizeof(ssize), numkeys,
+ sizeof(*numkeys));
+ if (is->method->debug > 2)
+ logf (LOG_LOG, "isc: flush ptr=%d numk=%d size=%d nextpos=%d",
+ i, *numkeys, (int) ssize, mb[i+1].block);
+ }
+ else
+ {
+ src = r_buf + mb[i].offset - ISAMC_BLOCK_OFFSET_N;
+ ssize += ISAMC_BLOCK_OFFSET_N;
+ if (is->method->debug > 2)
+ logf (LOG_LOG, "isc: flush ptr=%d size=%d nextpos=%d",
+ i, (int) ssize, mb[i+1].block);
+ }
+ memcpy (src, &mb[i+1].block, sizeof(int));
+ memcpy (src+sizeof(int), &ssize, sizeof(ssize));
+ isc_write_block (is, cat, mb[i].block, src);