Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into findnreplace

# Conflicts:
#	code/game/machinery/recharger.dm
#	code/game/objects/items/devices/autopsy.dm
#	code/game/objects/items/devices/modkit.dm
#	code/game/objects/structures/lattice.dm
This commit is contained in:
Markolie
2017-04-14 18:15:12 +02:00
280 changed files with 2179 additions and 1512 deletions
@@ -7,8 +7,12 @@
#define GC_FORCE_DEL_PER_TICK 30
//#define GC_DEBUG
// A list of types that were queued in the GC, and had to be soft deleted; used in testing
var/list/gc_hard_del_types = list()
var/list/didntgc = list() // list of all types that have failed to GC associated with the number of times that's happened.
// the types are stored as strings
var/list/sleptDestroy = list() //Same as above but these are paths that slept during their Destroy call
var/list/noqdelhint = list() // list of all types that do not return a QDEL_HINT
var/global/datum/controller/process/garbage_collector/garbageCollector
// The time a datum was destroyed by the GC, or null if it hasn't been
@@ -82,7 +86,7 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
#undef GC_COLLECTIONS_PER_TICK
/datum/controller/process/garbage_collector/proc/hardDel(var/datum/D)
gc_hard_del_types |= D.type
didntgc["[D.type]"]++
D.hard_deleted = 1
if(!D.gcDestroyed)
spawn(-1)
@@ -126,6 +130,7 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
return
if(!isnull(D.gcDestroyed) && D.gcDestroyed != world.time)
gcwarning("Sleep detected in Destroy() call of [D.type]")
sleptDestroy["[D.type]"]++
D.gcDestroyed = world.time
switch(hint)
@@ -155,7 +160,9 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
#endif
garbageCollector.addTrash(D)
else
// to_chat(world, "WARNING GC DID NOT GET A RETURN VALUE FOR [D], [D.type]!")
if(!noqdelhint["[D.type]"])
noqdelhint["[D.type]"] = "[D.type]"
gcwarning("WARNING: [D.type] is not returning a qdel hint. It is being placed in the queue. Further instances of this type will also be queued.")
garbageCollector.addTrash(D)
+15 -9
View File
@@ -13,21 +13,27 @@
log_admin("[key_name(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].")
message_admins("<span class='notice'>[key_name_admin(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].</span>", 1)
/client/proc/gc_dump_hdl()
set name = "(GC) Hard Del List"
set desc = "List types that are hard del()'d by the GC."
/client/proc/cmd_display_del_log()
set category = "Debug"
set name = "(GC) Display del() Log"
set desc = "Displays a list of things that have failed to GC this round"
if(!check_rights(R_DEBUG))
return
if(!gc_hard_del_types || !gc_hard_del_types.len)
to_chat(usr, "<span class='notice'>No hard del()'d types found.</span>")
return
var/dat = "<B>List of things that failed to GC this round</B><BR><BR>"
for(var/path in didntgc)
dat += "[path] - [didntgc[path]] times<BR>"
to_chat(usr, "Types hard del()'d by the GC:")
for(var/A in gc_hard_del_types)
to_chat(usr, "[A]")
dat += "<B>List of paths that did not return a qdel hint in Destroy()</B><BR><BR>"
for(var/path in noqdelhint)
dat += "[path]<BR>"
dat += "<B>List of paths that slept in Destroy()</B><BR><BR>"
for(var/path in sleptDestroy)
dat += "[path]<BR>"
usr << browse(dat, "window=dellog")
#ifdef TESTING
/client/var/running_find_references