X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=progsvm.h;h=92ead5dc772a8393f7a7470fee8cec35be11a78c;hb=b99206803156d4bdfe4ce0c83a2db8f9486e09d4;hp=4f0c36b49589a09747cb41adfc097f613a68f64b;hpb=aadd101471d0227217f84d3dc6ed03fec4aacd4c;p=xonotic%2Fdarkplaces.git diff --git a/progsvm.h b/progsvm.h index 4f0c36b4..92ead5dc 100644 --- a/progsvm.h +++ b/progsvm.h @@ -74,23 +74,27 @@ typedef struct prvm_required_field_s const char *name; } prvm_required_field_t; - +#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN -1 +#define PRVM_EDICT_MARK_SETORIGIN_CAUGHT -2 // AK: I dont call it engine private cause it doesnt really belongs to the engine // it belongs to prvm. typedef struct prvm_edict_private_s { - qbool free; - double freetime; // realtime of last change to "free" (i.e. also set on allocation) - int mark; // used during leaktest (0 = unref, >0 = referenced); special values during server physics: -#define PRVM_EDICT_MARK_WAIT_FOR_SETORIGIN -1 -#define PRVM_EDICT_MARK_SETORIGIN_CAUGHT -2 + // mark for the leak detector + int mark; + // place in the code where it was allocated (for the leak detector) const char *allocation_origin; } prvm_edict_private_t; typedef struct prvm_edict_s { + // true if this edict is unused + qbool free; + // sv.time when the object was freed (to prevent early reuse which could + // mess up client interpolation or obscure severe QuakeC bugs) + double freetime; + // engine-private fields (stored in dynamically resized array) - //edict_engineprivate_t *e; union { prvm_edict_private_t *required; @@ -631,7 +635,7 @@ typedef struct prvm_prog_s struct fssearch_s *opensearches[PRVM_MAX_OPENSEARCHES]; const char * opensearches_origin[PRVM_MAX_OPENSEARCHES]; struct skeleton_s *skeletons[MAX_EDICTS]; - struct cmd_state_s *console_cmd; // points to the relevant console command interpreter for this vm (&cmd_local), also used to access cvars + struct cmd_state_s *console_cmd; // points to the relevant console command interpreter for this vm (cmd_local or &cmd_server), also used to access cvars // buffer for storing all tempstrings created during one invocation of ExecuteProgram sizebuf_t tempstringsbuf;