]> git.xonotic.org Git - xonotic/darkplaces.git/commit
cmd: Reimplement console buffer system as a cyclic doubly linked list
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 Aug 2020 18:38:03 +0000 (18:38 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 9 Aug 2020 18:38:03 +0000 (18:38 +0000)
commit0b3a20bafb8ade687be7ff66ea8c5213d5434178
tree526038a8acf88eb9e46ae569990223cd515b32d4
parentb164365116c55794db3cfcc7d176bb28cee85f56
cmd: Reimplement console buffer system as a cyclic doubly linked list

This implements cbuf_t, cbuf_cmd_t, and an assorted array of helper
functions for handling the linked list(s). This also ports the defer
command to use the new system.

Each list node allocated will not be freed, except deferred commands,
mainly to avoid a Z_Malloc and Z_Free every time a player uses the
controls. Nodes are recycled in a separate linked list. This should be
okay as the memory usage is quite negligible

This new system has several advantages, namely, multiple command
interpreters may share the same console buffer on the same thread, and
each command will be executed in order, eliminating any potential bugs
related to execution order (which have already happened).

I haven't noticed any performance decrease and the new system works
exactly as the old one did.

Enjoy!

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12886 d7cf8633-e32d-0410-b094-e92efae38249
cl_demo.c
cmd.c
cmd.h
host.c
quakedef.h
sys_shared.c