mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-23 15:54:24 +03:00
Minor update
This commit is contained in:
parent
47af7dfe6a
commit
30b9f3d556
|
@ -19,16 +19,18 @@ from lib.core.exception import SqlmapSystemException
|
|||
from lib.core.settings import BIGARRAY_CHUNK_SIZE
|
||||
from lib.core.settings import BIGARRAY_TEMP_PREFIX
|
||||
|
||||
def _size_of(object):
|
||||
DEFAULT_SIZE_OF = sys.getsizeof(object())
|
||||
|
||||
def _size_of(object_):
|
||||
"""
|
||||
Returns total size of a given object (in bytes)
|
||||
Returns total size of a given object_ (in bytes)
|
||||
"""
|
||||
|
||||
retval = sys.getsizeof(object)
|
||||
if isinstance(object, dict):
|
||||
retval += sum(_size_of(_) for _ in itertools.chain.from_iterable(object.items()))
|
||||
elif hasattr(object, "__iter__"):
|
||||
retval += sum(_size_of(_) for _ in object)
|
||||
retval = sys.getsizeof(object_, DEFAULT_SIZE_OF)
|
||||
if isinstance(object_, dict):
|
||||
retval += sum(_size_of(_) for _ in itertools.chain.from_iterable(object_.items()))
|
||||
elif hasattr(object_, "__iter__"):
|
||||
retval += sum(_size_of(_) for _ in object_)
|
||||
return retval
|
||||
|
||||
class Cache(object):
|
||||
|
|
Loading…
Reference in New Issue
Block a user