Exemplo n.º 1
0
DENSITY_FORCE_INLINE density_buffer_processing_result density_buffer_return_processing_result(density_stream* stream, DENSITY_BUFFER_STATE state) {
    density_buffer_processing_result result;
    result.state = state;
    DENSITY_MEMCPY(&result.bytesRead, stream->totalBytesRead, sizeof(uint64_t));
    DENSITY_MEMCPY(&result.bytesWritten, stream->totalBytesWritten, sizeof(uint64_t));
    density_stream_destroy(stream);

    return result;
}
Exemplo n.º 2
0
 DENSITY_INLINE void
 dictionary_generic(location_t *in, location_t *out,
                    uint16_t *const hash, uint32_t *const chunk)
 {   DENSITY_MEMCPY(out->pointer, chunk, sizeof(*chunk));
     out->pointer += sizeof(*chunk);
     lion_dictionary_t::prediction_t *p = &(dictionary.predictions[last_hash]);
     update_predictions_model(p, *chunk); }
Exemplo n.º 3
0
 DENSITY_INLINE void
 prediction_generic(location_t *out, uint16_t *const hash,
                    uint32_t *const chunk)
 {   *hash = hash_algorithm(*chunk);
     DENSITY_MEMCPY(out->pointer, chunk, sizeof(*chunk));
     out->pointer += sizeof(*chunk); }
Exemplo n.º 4
0
 DENSITY_INLINE void
 read_hash(location_t *in, uint16_t *const hash)
 {   DENSITY_MEMCPY(hash, in->pointer, sizeof(uint16_t));
     in->pointer += sizeof(uint16_t); }
Exemplo n.º 5
0
 DENSITY_INLINE void read_signature_from_memory(location_t *in)
 {   DENSITY_MEMCPY(&signature, in->pointer, sizeof(signature));
     in->pointer += sizeof(signature); }