summaryrefslogtreecommitdiff
path: root/src/resources/resource.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-21 14:07:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-22 00:00:06 +0300
commit9ca479839b3a5fc7dbe75e94e15a0dd6da21bf16 (patch)
tree4aa2d89a08f00cad31d417ea790a4aa5a3455cde /src/resources/resource.cpp
parent20727e946194e9bf984fc9b4dd7687a59fc82fc1 (diff)
downloadplus-9ca479839b3a5fc7dbe75e94e15a0dd6da21bf16.tar.gz
plus-9ca479839b3a5fc7dbe75e94e15a0dd6da21bf16.tar.bz2
plus-9ca479839b3a5fc7dbe75e94e15a0dd6da21bf16.tar.xz
plus-9ca479839b3a5fc7dbe75e94e15a0dd6da21bf16.zip
Add memorycounter interface. Impliment it in Image.
Diffstat (limited to 'src/resources/resource.cpp')
-rw-r--r--src/resources/resource.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp
index 96524724b..40d44a7ec 100644
--- a/src/resources/resource.cpp
+++ b/src/resources/resource.cpp
@@ -24,6 +24,8 @@
#include "logger.h"
+#include "resources/memorycounter.h"
+#include "resources/memorymanager.h"
#include "resources/resourcemanager.h"
#include "debug.h"
@@ -68,3 +70,10 @@ void Resource::decRef()
resourceManager->release(this);
}
}
+
+int Resource::calcMemoryLocal()
+{
+ return sizeof(Resource) +
+ CAST_S32(mIdPath.size()) +
+ CAST_S32(mSource.size());
+}