1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 10:14:06 +02:00

use jemalloc

This commit is contained in:
Robin Appelman 2019-08-29 22:28:38 +02:00
commit 8e39a1ed50
5 changed files with 36 additions and 5 deletions

View file

@ -3,6 +3,11 @@ use std::fs;
pub use tf_demo_parser::{Demo, DemoParser, Parse, ParseError, ParserState, Result, Stream};
extern crate jemallocator;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
fn main() -> std::result::Result<(), Box<ParseError>> {
better_panic::install();

View file

@ -158,16 +158,14 @@ impl Parse for PacketEntitiesMessage {
let mut entity =
Self::read_enter(&mut data, entity_index, state, base_line as usize)?;
let send_table = get_send_table(state, entity.server_class)?;
let updated_props = Self::read_update(&mut data, send_table, &mut entity.props)?;
//entity.apply_update(updated_props);
Self::read_update(&mut data, send_table, &mut entity.props)?;
entities.push(entity);
} else if pvs == PVS::Preserve {
let mut entity = get_entity_for_update(state, entity_index, pvs)?;
let send_table = get_send_table(state, entity.server_class)?;
let updated_props = Self::read_update(&mut data, send_table, &mut entity.props)?;
// entity.props = updated_props;
Self::read_update(&mut data, send_table, &mut entity.props)?;
entities.push(entity);
} else if state.entity_classes.contains_key(&entity_index) {

View file

@ -158,7 +158,6 @@ impl ParserState {
let old_index = ent_message.base_line as usize;
let new_index = 1 - old_index;
self.instance_baselines.swap(0, 1);
//self.instance_baselines[new_index] = self.instance_baselines[new_index].clone();
for entity in ent_message.entities.iter() {
self.instance_baselines[new_index]