--[[----------------------------------------------------------------------------

KSLeaks.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2011 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remain the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and may be covered by U.S. and Foreign
Patents, patents in process, and are protected by trade secret or copyright
law.  Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

------------------------------------------------------------------------------]]

--[[

KSLeaks:

	This module provides support for leak tracking. It provides a single
	API to call to announce the existence of an object of a particular
	kind. It will generate debug log entries that track when the count goes
	up. This only works with table-based objects.
	
	function KSLeaks.registerObject( kind, obj )
		kind must be a string.
		obj must be nil or a table.

]]

--------------------------------------------------------------------------------

-- [scouten 2012-03-10]: Disable KSLeaks in non-debug builds. It's a fairly heavy
-- overhead to incur if nobody is going to be reading the results.

local ENABLE_COUNTING = false and _G.DEBUG

if ENABLE_COUNTING then

	return require 'KSLeaksImp'

else

	return {
		registerObject = function() end
	}

end
