Merge pull request #10590 from GinjaNinja32/debug

more debug stuff
This commit is contained in:
Chinsky
2015-08-13 05:22:45 +03:00
2 changed files with 9 additions and 19 deletions
+4 -19
View File
@@ -211,23 +211,14 @@ proc/listclearnulls(list/list)
return (result + R.Copy(Ri, 0))
//Mergesort: divides up the list into halves to begin the sort
/proc/sortAtom(var/list/atom/L, var/order = 1, first = 1)
/proc/sortAtom(var/list/atom/L, var/order = 1)
if(isnull(L) || L.len < 2)
if(!L)
testing("sortAtom() called with null as first parameter!")
return L
if(first)
var/msg = "sortAtom() called with list([L.len]): "
for(var/x in L)
msg += "'[x]'; "
testing(msg)
var/middle = L.len / 2 + 1
return mergeAtoms(sortAtom(L.Copy(0,middle), order, 0), sortAtom(L.Copy(middle), order, 0), order)
return mergeAtoms(sortAtom(L.Copy(0,middle)), sortAtom(L.Copy(middle)), order)
//Mergsort: does the actual sorting and returns the results back to sortAtom
/proc/mergeAtoms(var/list/atom/L, var/list/atom/R, var/order = 1)
if(!L || !R)
testing("mergeAtoms([L] ([L ? L.len : "*null*"]), [R] ([R ? R.len : "*null*"]))")
var/Li=1
var/Ri=1
var/list/result = new()
@@ -240,14 +231,8 @@ proc/listclearnulls(list/list)
result += R[Ri++]
if(Li <= L.len)
. = (result + L.Copy(Li, 0))
if(!.)
testing("mergeAtoms returning [.]")
return
. = (result + R.Copy(Ri, 0))
if(!.)
testing("mergeAtoms returning [.]")
return
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))
+5
View File
@@ -21,9 +21,14 @@
if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
initialize()
/proc/generate_debug_runtime() // Guaranteed to runtime and print a stack trace to the runtime log
var/t = 0 // BYOND won't let us do var/t = 1/0 directly, but it's fine with this.
t = 1 / t
/atom/movable/Del()
if(isnull(gcDestroyed) && loc)
testing("GC: -- [type] was deleted via del() rather than qdel() --")
generate_debug_runtime() // stick a stack trace in the runtime logs
// else if(isnull(gcDestroyed))
// testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel()
// else