lru-cacher 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +176 -100
- data/lib/lru-cacher/memory_limited.rb +3 -16
- data/lib/lru-cacher/memory_limited_java.rb +25 -0
- data/lib/lru-cacher/version.rb +1 -1
- data/lib/lru-cacher.rb +10 -9
- metadata +2 -2
- data/lru-cacher-1.0.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3c619769394498244b37077540bf3955844739
|
4
|
+
data.tar.gz: 02abd3fe501858f30081fcfcf954b7f50be310b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb94a50ccf2f9c47b8d8c7e2a9edd5b37dd981bf1b9e1cc2d3b74964b7a41adb9c2fd6d3dd2d3c54e897a97dc00f4ebb70114d0915e54b7db9904c334b8d16e0
|
7
|
+
data.tar.gz: 21deabe784184d20466d76d5b013914be9ed73ecf9f5393834a02fa63d5b500222dc0cc234ce53aba0df6f9a0c8573e44368d827490c578958467786d9ea0b1b
|
data/.idea/workspace.xml
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
4
|
<list default="true" id="53aeabdf-3e80-4df6-ab15-58d619b35ba5" name="Default" comment="">
|
5
|
+
<change type="DELETED" beforePath="$PROJECT_DIR$/lru-cacher-1.0.0.gem" afterPath="" />
|
6
|
+
<change type="DELETED" beforePath="$PROJECT_DIR$/lru-cacher-1.2.0.gem" afterPath="" />
|
7
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
5
8
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/lru-cacher/version.rb" afterPath="$PROJECT_DIR$/lib/lru-cacher/version.rb" />
|
6
9
|
</list>
|
7
10
|
<ignored path="lru-cache.iws" />
|
@@ -28,7 +31,7 @@
|
|
28
31
|
<SUITE FILE_PATH="coverage/lru-cacher@ItemLimited_delete_get_Moves_the_currently_gotten_item_to_the_tail_if_it_is_the_head___lru_cache.coverage" NAME="ItemLimited delete get Moves the currently gotten item to the tail if it is the head.: lru-cache Coverage Results" MODIFIED="1464731671149" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="lru-cache" />
|
29
32
|
<SUITE FILE_PATH="coverage/lru-cacher@ItemLimited_get_Moves_the_currently_gotten_item_to_the_tail_if_it_is_the_head___lru_cache.coverage" NAME="ItemLimited get Moves the currently gotten item to the tail if it is the head.: lru-cache Coverage Results" MODIFIED="1464734250712" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="lru-cache" />
|
30
33
|
<SUITE FILE_PATH="coverage/lru-cache@cache.coverage" NAME="cache Coverage Results" MODIFIED="1464038908022" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/lru" MODULE_NAME="lru-cache" />
|
31
|
-
<SUITE FILE_PATH="coverage/lru-cacher@Run_spec__service_spec___lru_cache.coverage" NAME="Run spec 'service_spec': lru-cache Coverage Results" MODIFIED="
|
34
|
+
<SUITE FILE_PATH="coverage/lru-cacher@Run_spec__service_spec___lru_cache.coverage" NAME="Run spec 'service_spec': lru-cache Coverage Results" MODIFIED="1464748483268" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="lru-cache" />
|
32
35
|
<SUITE FILE_PATH="coverage/lru-cacher@MemoryLimited_delete_Resets_the_head_node_if_head_is_deleted__and_pops_off_the_correct_item_after__lru_cache.coverage" NAME="MemoryLimited delete Resets the head node if head is deleted, and pops off the correct item after: lru-cache Coverage Results" MODIFIED="1464734036474" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="lru-cache" />
|
33
36
|
<SUITE FILE_PATH="coverage/lru-cacher@ItemLimited_Replaces_resets_the_head_node_if_head_is_deleted__and_pops_off_the_correct_item_after__lru_cache.coverage" NAME="ItemLimited Replaces resets the head node if head is deleted, and pops off the correct item after: lru-cache Coverage Results" MODIFIED="1464729820800" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="lru-cache" />
|
34
37
|
<SUITE FILE_PATH="coverage/lru-cacher@ItemLimited__lru_cache.coverage" NAME="ItemLimited: lru-cache Coverage Results" MODIFIED="1464733225942" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="lru-cache" />
|
@@ -53,8 +56,8 @@
|
|
53
56
|
<file leaf-file-name="lru-cacher.rb" pinned="false" current-in-tab="false">
|
54
57
|
<entry file="file://$PROJECT_DIR$/lib/lru-cacher.rb">
|
55
58
|
<provider selected="true" editor-type-id="text-editor">
|
56
|
-
<state relative-caret-position="
|
57
|
-
<caret line="
|
59
|
+
<state relative-caret-position="825">
|
60
|
+
<caret line="55" column="0" selection-start-line="55" selection-start-column="0" selection-end-line="55" selection-end-column="0" />
|
58
61
|
<folding />
|
59
62
|
</state>
|
60
63
|
</provider>
|
@@ -63,8 +66,8 @@
|
|
63
66
|
<file leaf-file-name="service_spec.rb" pinned="false" current-in-tab="false">
|
64
67
|
<entry file="file://$PROJECT_DIR$/spec/unit/service_spec.rb">
|
65
68
|
<provider selected="true" editor-type-id="text-editor">
|
66
|
-
<state relative-caret-position="
|
67
|
-
<caret line="
|
69
|
+
<state relative-caret-position="285">
|
70
|
+
<caret line="19" column="0" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
|
68
71
|
<folding />
|
69
72
|
</state>
|
70
73
|
</provider>
|
@@ -83,7 +86,7 @@
|
|
83
86
|
<file leaf-file-name="support.rb" pinned="false" current-in-tab="false">
|
84
87
|
<entry file="file://$PROJECT_DIR$/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support.rb">
|
85
88
|
<provider selected="true" editor-type-id="text-editor">
|
86
|
-
<state relative-caret-position="
|
89
|
+
<state relative-caret-position="1905">
|
87
90
|
<caret line="127" column="0" selection-start-line="127" selection-start-column="0" selection-end-line="127" selection-end-column="0" />
|
88
91
|
<folding />
|
89
92
|
</state>
|
@@ -103,8 +106,8 @@
|
|
103
106
|
<file leaf-file-name="example.rb" pinned="false" current-in-tab="false">
|
104
107
|
<entry file="file://$PROJECT_DIR$/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/example.rb">
|
105
108
|
<provider selected="true" editor-type-id="text-editor">
|
106
|
-
<state relative-caret-position="
|
107
|
-
<caret line="
|
109
|
+
<state relative-caret-position="5700">
|
110
|
+
<caret line="380" column="0" selection-start-line="380" selection-start-column="0" selection-end-line="380" selection-end-column="0" />
|
108
111
|
<folding />
|
109
112
|
</state>
|
110
113
|
</provider>
|
@@ -120,11 +123,11 @@
|
|
120
123
|
</provider>
|
121
124
|
</entry>
|
122
125
|
</file>
|
123
|
-
<file leaf-file-name="
|
124
|
-
<entry file="file://$
|
126
|
+
<file leaf-file-name="memory_limited_java.rb" pinned="false" current-in-tab="false">
|
127
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/memory_limited_java.rb">
|
125
128
|
<provider selected="true" editor-type-id="text-editor">
|
126
|
-
<state relative-caret-position="
|
127
|
-
<caret line="
|
129
|
+
<state relative-caret-position="360">
|
130
|
+
<caret line="24" column="36" selection-start-line="24" selection-start-column="3" selection-end-line="24" selection-end-column="3" />
|
128
131
|
<folding />
|
129
132
|
</state>
|
130
133
|
</provider>
|
@@ -133,8 +136,8 @@
|
|
133
136
|
<file leaf-file-name="memory_limited.rb" pinned="false" current-in-tab="false">
|
134
137
|
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/memory_limited.rb">
|
135
138
|
<provider selected="true" editor-type-id="text-editor">
|
136
|
-
<state relative-caret-position="
|
137
|
-
<caret line="
|
139
|
+
<state relative-caret-position="15">
|
140
|
+
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
|
138
141
|
<folding />
|
139
142
|
</state>
|
140
143
|
</provider>
|
@@ -177,10 +180,11 @@
|
|
177
180
|
<option value="$PROJECT_DIR$/lib/lru-cacher/node.rb" />
|
178
181
|
<option value="$PROJECT_DIR$/spec/spec_helper.rb" />
|
179
182
|
<option value="$PROJECT_DIR$/lru-cacher.gemspec" />
|
180
|
-
<option value="$PROJECT_DIR$/lib/lru-cacher.rb" />
|
181
|
-
<option value="$PROJECT_DIR$/spec/unit/service_spec.rb" />
|
182
183
|
<option value="$PROJECT_DIR$/lib/lru-cacher/item_limited.rb" />
|
183
184
|
<option value="$PROJECT_DIR$/lib/lru-cacher/memory_limited.rb" />
|
185
|
+
<option value="$PROJECT_DIR$/lib/lru-cacher/memory_limited_java.rb" />
|
186
|
+
<option value="$PROJECT_DIR$/spec/unit/service_spec.rb" />
|
187
|
+
<option value="$PROJECT_DIR$/lib/lru-cacher.rb" />
|
184
188
|
<option value="$PROJECT_DIR$/lib/lru-cacher/version.rb" />
|
185
189
|
</list>
|
186
190
|
</option>
|
@@ -192,8 +196,8 @@
|
|
192
196
|
</component>
|
193
197
|
<component name="ProjectFrameBounds">
|
194
198
|
<option name="y" value="23" />
|
195
|
-
<option name="width" value="
|
196
|
-
<option name="height" value="
|
199
|
+
<option name="width" value="1920" />
|
200
|
+
<option name="height" value="993" />
|
197
201
|
</component>
|
198
202
|
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
199
203
|
<OptionsSetting value="true" id="Add" />
|
@@ -221,6 +225,7 @@
|
|
221
225
|
</navigator>
|
222
226
|
<panes>
|
223
227
|
<pane id="Scope" />
|
228
|
+
<pane id="Scratches" />
|
224
229
|
<pane id="ProjectPane">
|
225
230
|
<subPane>
|
226
231
|
<PATH>
|
@@ -305,7 +310,6 @@
|
|
305
310
|
</PATH>
|
306
311
|
</subPane>
|
307
312
|
</pane>
|
308
|
-
<pane id="Scratches" />
|
309
313
|
</panes>
|
310
314
|
</component>
|
311
315
|
<component name="PropertiesComponent">
|
@@ -316,10 +320,11 @@
|
|
316
320
|
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
|
317
321
|
<property name="settings.editor.splitter.proportion" value="0.2" />
|
318
322
|
<property name="WebServerToolWindowFactoryState" value="false" />
|
319
|
-
<property name="last_opened_file_path" value="$PROJECT_DIR
|
323
|
+
<property name="last_opened_file_path" value="$PROJECT_DIR$/../zombie-eng-eh-zed-action-instance-processor" />
|
320
324
|
</component>
|
321
325
|
<component name="RecentsManager">
|
322
326
|
<key name="CopyFile.RECENT_KEYS">
|
327
|
+
<recent name="$PROJECT_DIR$/lib/lru-cacher" />
|
323
328
|
<recent name="$PROJECT_DIR$" />
|
324
329
|
</key>
|
325
330
|
<key name="MoveFile.RECENT_KEYS">
|
@@ -632,11 +637,11 @@
|
|
632
637
|
</list>
|
633
638
|
<recent_temporary>
|
634
639
|
<list size="5">
|
635
|
-
<item index="0" class="java.lang.String" itemvalue="RSpec.
|
636
|
-
<item index="1" class="java.lang.String" itemvalue="RSpec.
|
637
|
-
<item index="2" class="java.lang.String" itemvalue="RSpec.MemoryLimited: lru-cache" />
|
638
|
-
<item index="3" class="java.lang.String" itemvalue="RSpec.MemoryLimited delete Resets the
|
639
|
-
<item index="4" class="java.lang.String" itemvalue="RSpec.MemoryLimited
|
640
|
+
<item index="0" class="java.lang.String" itemvalue="RSpec.ItemLimited get Moves the currently gotten item to the tail if it is the head.: lru-cache" />
|
641
|
+
<item index="1" class="java.lang.String" itemvalue="RSpec.Run spec 'service_spec': lru-cache" />
|
642
|
+
<item index="2" class="java.lang.String" itemvalue="RSpec.MemoryLimited delete Resets the head node if head is deleted, and pops off the correct item after: lru-cache" />
|
643
|
+
<item index="3" class="java.lang.String" itemvalue="RSpec.MemoryLimited delete Resets the tail node if tail is deleted, and pops off the correct item after: lru-cache" />
|
644
|
+
<item index="4" class="java.lang.String" itemvalue="RSpec.MemoryLimited: lru-cache" />
|
640
645
|
</list>
|
641
646
|
</recent_temporary>
|
642
647
|
</component>
|
@@ -658,7 +663,8 @@
|
|
658
663
|
<workItem from="1464367720537" duration="1769000" />
|
659
664
|
<workItem from="1464491463402" duration="21000" />
|
660
665
|
<workItem from="1464645948749" duration="3900000" />
|
661
|
-
<workItem from="1464716481526" duration="
|
666
|
+
<workItem from="1464716481526" duration="15153000" />
|
667
|
+
<workItem from="1464796364902" duration="2084000" />
|
662
668
|
</task>
|
663
669
|
<servers />
|
664
670
|
</component>
|
@@ -669,56 +675,56 @@
|
|
669
675
|
<history-entry file="ItemLimited_get_Moves_the_currently_gotten_item_to_the_tail_if_it_is_the_head___lru-cache - 2016.05.31 at 17h 38m 32s.xml">
|
670
676
|
<configuration name="ItemLimited get Moves the currently gotten item to the tail if it is the head.: lru-cache" configurationId="RSpecRunConfigurationType" />
|
671
677
|
</history-entry>
|
672
|
-
<history-entry file="MemoryLimited__lru-cache - 2016.05.31 at 17h 32m 46s.xml">
|
673
|
-
<configuration name="MemoryLimited: lru-cache" configurationId="RSpecRunConfigurationType" />
|
674
|
-
</history-entry>
|
675
|
-
<history-entry file="MemoryLimited__lru-cache - 2016.05.31 at 17h 33m 37s.xml">
|
676
|
-
<configuration name="MemoryLimited: lru-cache" configurationId="RSpecRunConfigurationType" />
|
677
|
-
</history-entry>
|
678
678
|
<history-entry file="MemoryLimited__lru-cache - 2016.05.31 at 17h 35m 04s.xml">
|
679
679
|
<configuration name="MemoryLimited: lru-cache" configurationId="RSpecRunConfigurationType" />
|
680
680
|
</history-entry>
|
681
|
-
<history-entry file="MemoryLimited_delete_Resets_the_head_node_if_head_is_deleted,_and_pops_off_the_correct_item_after__lru-cache - 2016.05.31 at 17h 33m 54s.xml">
|
682
|
-
<configuration name="MemoryLimited delete Resets the head node if head is deleted, and pops off the correct item after: lru-cache" configurationId="RSpecRunConfigurationType" />
|
683
|
-
</history-entry>
|
684
681
|
<history-entry file="MemoryLimited_delete_Resets_the_head_node_if_head_is_deleted,_and_pops_off_the_correct_item_after__lru-cache - 2016.05.31 at 17h 34m 53s.xml">
|
685
682
|
<configuration name="MemoryLimited delete Resets the head node if head is deleted, and pops off the correct item after: lru-cache" configurationId="RSpecRunConfigurationType" />
|
686
683
|
</history-entry>
|
687
|
-
<history-entry file="MemoryLimited_delete_Resets_the_tail_node_if_tail_is_deleted,_and_pops_off_the_correct_item_after__lru-cache - 2016.05.31 at 17h 32m 34s.xml">
|
688
|
-
<configuration name="MemoryLimited delete Resets the tail node if tail is deleted, and pops off the correct item after: lru-cache" configurationId="RSpecRunConfigurationType" />
|
689
|
-
</history-entry>
|
690
684
|
<history-entry file="Run_spec_'service_spec'__lru-cache - 2016.05.31 at 17h 35m 13s.xml">
|
691
685
|
<configuration name="Run spec 'service_spec': lru-cache" configurationId="RSpecRunConfigurationType" />
|
692
686
|
</history-entry>
|
693
687
|
<history-entry file="Run_spec_'service_spec'__lru-cache - 2016.05.31 at 17h 38m 42s.xml">
|
694
688
|
<configuration name="Run spec 'service_spec': lru-cache" configurationId="RSpecRunConfigurationType" />
|
695
689
|
</history-entry>
|
690
|
+
<history-entry file="Run_spec_'service_spec'__lru-cache - 2016.05.31 at 21h 15m 31s.xml">
|
691
|
+
<configuration name="Run spec 'service_spec': lru-cache" configurationId="RSpecRunConfigurationType" />
|
692
|
+
</history-entry>
|
693
|
+
<history-entry file="Run_spec_'service_spec'__lru-cache - 2016.05.31 at 21h 19m 29s.xml">
|
694
|
+
<configuration name="Run spec 'service_spec': lru-cache" configurationId="RSpecRunConfigurationType" />
|
695
|
+
</history-entry>
|
696
|
+
<history-entry file="Run_spec_'service_spec'__lru-cache - 2016.05.31 at 21h 19m 59s.xml">
|
697
|
+
<configuration name="Run spec 'service_spec': lru-cache" configurationId="RSpecRunConfigurationType" />
|
698
|
+
</history-entry>
|
699
|
+
<history-entry file="Run_spec_'service_spec'__lru-cache - 2016.05.31 at 21h 40m 28s.xml">
|
700
|
+
<configuration name="Run spec 'service_spec': lru-cache" configurationId="RSpecRunConfigurationType" />
|
701
|
+
</history-entry>
|
696
702
|
</component>
|
697
703
|
<component name="TimeTrackingManager">
|
698
|
-
<option name="totallyTimeSpent" value="
|
704
|
+
<option name="totallyTimeSpent" value="36794000" />
|
699
705
|
</component>
|
700
706
|
<component name="ToolWindowManager">
|
701
|
-
<frame x="0" y="23" width="
|
702
|
-
<editor active="
|
707
|
+
<frame x="0" y="23" width="1920" height="993" extended-state="6" />
|
708
|
+
<editor active="false" />
|
703
709
|
<layout>
|
704
|
-
<window_info id="Project" active="
|
710
|
+
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19116081" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
705
711
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
706
712
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3289941" sideWeight="0.5" order="9" side_tool="true" content_ui="tabs" />
|
707
713
|
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
708
714
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
|
709
|
-
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.45088756" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
710
715
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
711
716
|
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.08047337" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
712
717
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
713
|
-
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.464" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
714
718
|
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
715
719
|
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
716
720
|
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
717
721
|
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
718
722
|
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
723
|
+
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.45088756" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
719
724
|
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
720
|
-
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="
|
725
|
+
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3289941" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
721
726
|
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
727
|
+
<window_info id="Debug" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.46627218" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
722
728
|
</layout>
|
723
729
|
</component>
|
724
730
|
<component name="Vcs.Log.UiProperties">
|
@@ -735,44 +741,34 @@
|
|
735
741
|
<component name="XDebuggerManager">
|
736
742
|
<breakpoint-manager>
|
737
743
|
<breakpoints>
|
738
|
-
<line-breakpoint enabled="true" type="ruby-line">
|
739
|
-
<url>file://$PROJECT_DIR$/lib/lru-cacher/memory_limited.rb</url>
|
740
|
-
<line>9</line>
|
741
|
-
<option name="timeStamp" value="11" />
|
742
|
-
</line-breakpoint>
|
743
|
-
<line-breakpoint enabled="true" type="ruby-line">
|
744
|
-
<url>file://$PROJECT_DIR$/lib/lru-cacher/memory_limited.rb</url>
|
745
|
-
<line>16</line>
|
746
|
-
<option name="timeStamp" value="16" />
|
747
|
-
</line-breakpoint>
|
748
744
|
<line-breakpoint enabled="true" type="ruby-line">
|
749
745
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
750
|
-
<line>
|
746
|
+
<line>140</line>
|
751
747
|
<option name="timeStamp" value="17" />
|
752
748
|
</line-breakpoint>
|
753
749
|
<line-breakpoint enabled="true" type="ruby-line">
|
754
750
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
755
|
-
<line>
|
751
|
+
<line>145</line>
|
756
752
|
<option name="timeStamp" value="18" />
|
757
753
|
</line-breakpoint>
|
758
754
|
<line-breakpoint enabled="true" type="ruby-line">
|
759
755
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
760
|
-
<line>
|
756
|
+
<line>189</line>
|
761
757
|
<option name="timeStamp" value="19" />
|
762
758
|
</line-breakpoint>
|
763
759
|
<line-breakpoint enabled="true" type="ruby-line">
|
764
760
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
765
|
-
<line>
|
761
|
+
<line>212</line>
|
766
762
|
<option name="timeStamp" value="21" />
|
767
763
|
</line-breakpoint>
|
768
764
|
<line-breakpoint enabled="true" type="ruby-line">
|
769
765
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
770
|
-
<line>
|
766
|
+
<line>219</line>
|
771
767
|
<option name="timeStamp" value="22" />
|
772
768
|
</line-breakpoint>
|
773
769
|
<line-breakpoint enabled="true" type="ruby-line">
|
774
770
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
775
|
-
<line>
|
771
|
+
<line>168</line>
|
776
772
|
<option name="timeStamp" value="23" />
|
777
773
|
</line-breakpoint>
|
778
774
|
<line-breakpoint enabled="true" type="ruby-line">
|
@@ -782,16 +778,26 @@
|
|
782
778
|
</line-breakpoint>
|
783
779
|
<line-breakpoint enabled="true" type="ruby-line">
|
784
780
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
785
|
-
<line>
|
781
|
+
<line>67</line>
|
786
782
|
<option name="timeStamp" value="27" />
|
787
783
|
</line-breakpoint>
|
788
784
|
<line-breakpoint enabled="true" type="ruby-line">
|
789
785
|
<url>file://$PROJECT_DIR$/spec/unit/service_spec.rb</url>
|
790
|
-
<line>
|
786
|
+
<line>245</line>
|
791
787
|
<option name="timeStamp" value="28" />
|
792
788
|
</line-breakpoint>
|
789
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
790
|
+
<url>file://$PROJECT_DIR$/lib/lru-cacher.rb</url>
|
791
|
+
<line>47</line>
|
792
|
+
<option name="timeStamp" value="29" />
|
793
|
+
</line-breakpoint>
|
794
|
+
<line-breakpoint enabled="true" type="ruby-line">
|
795
|
+
<url>file://$PROJECT_DIR$/lib/lru-cacher/memory_limited_java.rb</url>
|
796
|
+
<line>21</line>
|
797
|
+
<option name="timeStamp" value="30" />
|
798
|
+
</line-breakpoint>
|
793
799
|
</breakpoints>
|
794
|
-
<option name="time" value="
|
800
|
+
<option name="time" value="31" />
|
795
801
|
</breakpoint-manager>
|
796
802
|
<watches-manager>
|
797
803
|
<configuration name="RubyRunConfigurationType">
|
@@ -800,22 +806,93 @@
|
|
800
806
|
<watch expression="current_node.next_node " />
|
801
807
|
</configuration>
|
802
808
|
<configuration name="RSpecRunConfigurationType">
|
803
|
-
<watch expression="((@mem_mx_bean.heap_memory_usage.used + mem.non_heap_memory_usage.used) / 1048576) " />
|
804
809
|
<watch expression="((@mem_mx_bean.heap_memory_usage.used + @mem_mx_bean.non_heap_memory_usage.used) / 1048576)" />
|
805
|
-
<watch expression="
|
806
|
-
<watch expression="
|
807
|
-
<watch expression="@table.key? key" />
|
808
|
-
<watch expression="mem_cache.table[:two].next_node.key" />
|
809
|
-
<watch expression="mem_cache.table[:one]" />
|
810
|
-
<watch expression="@table.size" language="ruby" />
|
811
|
-
<watch expression="mem_cache.instance_variable_get(:@head).key" />
|
812
|
-
<watch expression="mem_cache.instance_variable_get(:@tail).key" />
|
813
|
-
<watch expression="mem_cache.instance_variable_get(:@table)" />
|
814
|
-
<watch expression="@table.size" language="ruby" />
|
810
|
+
<watch expression="@tail.next_node" language="ruby" />
|
811
|
+
<watch expression="new_node.prev_node" language="ruby" />
|
815
812
|
</configuration>
|
816
813
|
</watches-manager>
|
817
814
|
</component>
|
818
815
|
<component name="editorHistoryManager">
|
816
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher.rb">
|
817
|
+
<provider selected="true" editor-type-id="text-editor">
|
818
|
+
<state relative-caret-position="825">
|
819
|
+
<caret line="55" column="0" selection-start-line="55" selection-start-column="0" selection-end-line="55" selection-end-column="0" />
|
820
|
+
<folding />
|
821
|
+
</state>
|
822
|
+
</provider>
|
823
|
+
</entry>
|
824
|
+
<entry file="file://$PROJECT_DIR$/spec/unit/service_spec.rb">
|
825
|
+
<provider selected="true" editor-type-id="text-editor">
|
826
|
+
<state relative-caret-position="0">
|
827
|
+
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
828
|
+
<folding />
|
829
|
+
</state>
|
830
|
+
</provider>
|
831
|
+
</entry>
|
832
|
+
<entry file="file://$PROJECT_DIR$/vendor/bundle/bin/rspec">
|
833
|
+
<provider selected="true" editor-type-id="text-editor">
|
834
|
+
<state relative-caret-position="330">
|
835
|
+
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
|
836
|
+
<folding />
|
837
|
+
</state>
|
838
|
+
</provider>
|
839
|
+
</entry>
|
840
|
+
<entry file="file://$PROJECT_DIR$/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support.rb">
|
841
|
+
<provider selected="true" editor-type-id="text-editor">
|
842
|
+
<state relative-caret-position="1905">
|
843
|
+
<caret line="127" column="0" selection-start-line="127" selection-start-column="0" selection-end-line="127" selection-end-column="0" />
|
844
|
+
<folding />
|
845
|
+
</state>
|
846
|
+
</provider>
|
847
|
+
</entry>
|
848
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/version.rb">
|
849
|
+
<provider selected="true" editor-type-id="text-editor">
|
850
|
+
<state relative-caret-position="15">
|
851
|
+
<caret line="1" column="16" selection-start-line="1" selection-start-column="16" selection-end-line="1" selection-end-column="16" />
|
852
|
+
<folding />
|
853
|
+
</state>
|
854
|
+
</provider>
|
855
|
+
</entry>
|
856
|
+
<entry file="file://$PROJECT_DIR$/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/example.rb">
|
857
|
+
<provider selected="true" editor-type-id="text-editor">
|
858
|
+
<state relative-caret-position="5700">
|
859
|
+
<caret line="380" column="0" selection-start-line="380" selection-start-column="0" selection-end-line="380" selection-end-column="0" />
|
860
|
+
<folding />
|
861
|
+
</state>
|
862
|
+
</provider>
|
863
|
+
</entry>
|
864
|
+
<entry file="file://$PROJECT_DIR$/lru-cacher.gemspec">
|
865
|
+
<provider selected="true" editor-type-id="text-editor">
|
866
|
+
<state relative-caret-position="285">
|
867
|
+
<caret line="19" column="30" selection-start-line="19" selection-start-column="30" selection-end-line="19" selection-end-column="30" />
|
868
|
+
<folding />
|
869
|
+
</state>
|
870
|
+
</provider>
|
871
|
+
</entry>
|
872
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/memory_limited_java.rb">
|
873
|
+
<provider selected="true" editor-type-id="text-editor">
|
874
|
+
<state relative-caret-position="315">
|
875
|
+
<caret line="21" column="0" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
|
876
|
+
<folding />
|
877
|
+
</state>
|
878
|
+
</provider>
|
879
|
+
</entry>
|
880
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/memory_limited.rb">
|
881
|
+
<provider selected="true" editor-type-id="text-editor">
|
882
|
+
<state relative-caret-position="15">
|
883
|
+
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
|
884
|
+
<folding />
|
885
|
+
</state>
|
886
|
+
</provider>
|
887
|
+
</entry>
|
888
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/item_limited.rb">
|
889
|
+
<provider selected="true" editor-type-id="text-editor">
|
890
|
+
<state relative-caret-position="150">
|
891
|
+
<caret line="10" column="3" selection-start-line="10" selection-start-column="3" selection-end-line="10" selection-end-column="3" />
|
892
|
+
<folding />
|
893
|
+
</state>
|
894
|
+
</provider>
|
895
|
+
</entry>
|
819
896
|
<entry file="file://$PROJECT_DIR$/lib/lru-cacher.rb">
|
820
897
|
<provider selected="true" editor-type-id="text-editor">
|
821
898
|
<state relative-caret-position="0">
|
@@ -844,7 +921,6 @@
|
|
844
921
|
<provider selected="true" editor-type-id="text-editor">
|
845
922
|
<state relative-caret-position="330">
|
846
923
|
<caret line="22" column="18" selection-start-line="22" selection-start-column="18" selection-end-line="22" selection-end-column="18" />
|
847
|
-
<folding />
|
848
924
|
</state>
|
849
925
|
</provider>
|
850
926
|
</entry>
|
@@ -868,7 +944,6 @@
|
|
868
944
|
<provider selected="true" editor-type-id="text-editor">
|
869
945
|
<state relative-caret-position="810">
|
870
946
|
<caret line="54" column="0" selection-start-line="54" selection-start-column="0" selection-end-line="54" selection-end-column="0" />
|
871
|
-
<folding />
|
872
947
|
</state>
|
873
948
|
</provider>
|
874
949
|
</entry>
|
@@ -900,7 +975,6 @@
|
|
900
975
|
<provider selected="true" editor-type-id="text-editor">
|
901
976
|
<state relative-caret-position="330">
|
902
977
|
<caret line="22" column="18" selection-start-line="22" selection-start-column="18" selection-end-line="22" selection-end-column="18" />
|
903
|
-
<folding />
|
904
978
|
</state>
|
905
979
|
</provider>
|
906
980
|
</entry>
|
@@ -924,7 +998,6 @@
|
|
924
998
|
<provider selected="true" editor-type-id="text-editor">
|
925
999
|
<state relative-caret-position="810">
|
926
1000
|
<caret line="54" column="0" selection-start-line="54" selection-start-column="0" selection-end-line="54" selection-end-column="0" />
|
927
|
-
<folding />
|
928
1001
|
</state>
|
929
1002
|
</provider>
|
930
1003
|
</entry>
|
@@ -956,7 +1029,6 @@
|
|
956
1029
|
<provider selected="true" editor-type-id="text-editor">
|
957
1030
|
<state relative-caret-position="330">
|
958
1031
|
<caret line="22" column="18" selection-start-line="22" selection-start-column="18" selection-end-line="22" selection-end-column="18" />
|
959
|
-
<folding />
|
960
1032
|
</state>
|
961
1033
|
</provider>
|
962
1034
|
</entry>
|
@@ -980,7 +1052,6 @@
|
|
980
1052
|
<provider selected="true" editor-type-id="text-editor">
|
981
1053
|
<state relative-caret-position="810">
|
982
1054
|
<caret line="54" column="0" selection-start-line="54" selection-start-column="0" selection-end-line="54" selection-end-column="0" />
|
983
|
-
<folding />
|
984
1055
|
</state>
|
985
1056
|
</provider>
|
986
1057
|
</entry>
|
@@ -1003,7 +1074,6 @@
|
|
1003
1074
|
<provider selected="true" editor-type-id="text-editor">
|
1004
1075
|
<state relative-caret-position="330">
|
1005
1076
|
<caret line="22" column="18" selection-start-line="22" selection-start-column="18" selection-end-line="22" selection-end-column="18" />
|
1006
|
-
<folding />
|
1007
1077
|
</state>
|
1008
1078
|
</provider>
|
1009
1079
|
</entry>
|
@@ -1011,7 +1081,6 @@
|
|
1011
1081
|
<provider selected="true" editor-type-id="text-editor">
|
1012
1082
|
<state relative-caret-position="810">
|
1013
1083
|
<caret line="54" column="0" selection-start-line="54" selection-start-column="0" selection-end-line="54" selection-end-column="0" />
|
1014
|
-
<folding />
|
1015
1084
|
</state>
|
1016
1085
|
</provider>
|
1017
1086
|
</entry>
|
@@ -1027,7 +1096,6 @@
|
|
1027
1096
|
<provider selected="true" editor-type-id="text-editor">
|
1028
1097
|
<state relative-caret-position="105">
|
1029
1098
|
<caret line="7" column="56" selection-start-line="7" selection-start-column="56" selection-end-line="7" selection-end-column="56" />
|
1030
|
-
<folding />
|
1031
1099
|
</state>
|
1032
1100
|
</provider>
|
1033
1101
|
</entry>
|
@@ -1057,48 +1125,56 @@
|
|
1057
1125
|
</entry>
|
1058
1126
|
<entry file="file://$PROJECT_DIR$/vendor/bundle/gems/rspec-support-3.4.1/lib/rspec/support.rb">
|
1059
1127
|
<provider selected="true" editor-type-id="text-editor">
|
1060
|
-
<state relative-caret-position="
|
1128
|
+
<state relative-caret-position="1905">
|
1061
1129
|
<caret line="127" column="0" selection-start-line="127" selection-start-column="0" selection-end-line="127" selection-end-column="0" />
|
1062
1130
|
<folding />
|
1063
1131
|
</state>
|
1064
1132
|
</provider>
|
1065
1133
|
</entry>
|
1066
|
-
<entry file="file://$PROJECT_DIR$/
|
1134
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/item_limited.rb">
|
1067
1135
|
<provider selected="true" editor-type-id="text-editor">
|
1068
|
-
<state relative-caret-position="
|
1069
|
-
<caret line="
|
1136
|
+
<state relative-caret-position="150">
|
1137
|
+
<caret line="10" column="3" selection-start-line="10" selection-start-column="3" selection-end-line="10" selection-end-column="3" />
|
1070
1138
|
<folding />
|
1071
1139
|
</state>
|
1072
1140
|
</provider>
|
1073
1141
|
</entry>
|
1074
|
-
<entry file="file://$PROJECT_DIR$/lib/lru-cacher.rb">
|
1142
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/memory_limited.rb">
|
1075
1143
|
<provider selected="true" editor-type-id="text-editor">
|
1076
|
-
<state relative-caret-position="
|
1077
|
-
<caret line="
|
1144
|
+
<state relative-caret-position="15">
|
1145
|
+
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
|
1078
1146
|
<folding />
|
1079
1147
|
</state>
|
1080
1148
|
</provider>
|
1081
1149
|
</entry>
|
1082
|
-
<entry file="file://$PROJECT_DIR$/
|
1150
|
+
<entry file="file://$PROJECT_DIR$/vendor/bundle/gems/rspec-core-3.4.4/lib/rspec/core/example.rb">
|
1083
1151
|
<provider selected="true" editor-type-id="text-editor">
|
1084
|
-
<state relative-caret-position="
|
1085
|
-
<caret line="
|
1152
|
+
<state relative-caret-position="5700">
|
1153
|
+
<caret line="380" column="0" selection-start-line="380" selection-start-column="0" selection-end-line="380" selection-end-column="0" />
|
1086
1154
|
<folding />
|
1087
1155
|
</state>
|
1088
1156
|
</provider>
|
1089
1157
|
</entry>
|
1090
|
-
<entry file="file://$PROJECT_DIR$/
|
1158
|
+
<entry file="file://$PROJECT_DIR$/spec/unit/service_spec.rb">
|
1091
1159
|
<provider selected="true" editor-type-id="text-editor">
|
1092
|
-
<state relative-caret-position="
|
1093
|
-
<caret line="
|
1160
|
+
<state relative-caret-position="285">
|
1161
|
+
<caret line="19" column="0" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
|
1094
1162
|
<folding />
|
1095
1163
|
</state>
|
1096
1164
|
</provider>
|
1097
1165
|
</entry>
|
1098
|
-
<entry file="file://$PROJECT_DIR$/
|
1166
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher/memory_limited_java.rb">
|
1099
1167
|
<provider selected="true" editor-type-id="text-editor">
|
1100
|
-
<state relative-caret-position="
|
1101
|
-
<caret line="
|
1168
|
+
<state relative-caret-position="360">
|
1169
|
+
<caret line="24" column="36" selection-start-line="24" selection-start-column="3" selection-end-line="24" selection-end-column="3" />
|
1170
|
+
<folding />
|
1171
|
+
</state>
|
1172
|
+
</provider>
|
1173
|
+
</entry>
|
1174
|
+
<entry file="file://$PROJECT_DIR$/lib/lru-cacher.rb">
|
1175
|
+
<provider selected="true" editor-type-id="text-editor">
|
1176
|
+
<state relative-caret-position="825">
|
1177
|
+
<caret line="55" column="0" selection-start-line="55" selection-start-column="0" selection-end-line="55" selection-end-column="0" />
|
1102
1178
|
<folding />
|
1103
1179
|
</state>
|
1104
1180
|
</provider>
|
@@ -1,25 +1,12 @@
|
|
1
1
|
require 'lib/lru-cacher'
|
2
|
-
require '
|
3
|
-
import java.lang.management.ManagementFactory
|
2
|
+
require 'objspace'
|
4
3
|
|
5
|
-
class
|
4
|
+
class MemoryLimitedJ < LRUCacher
|
6
5
|
def initialize(max_mem_size)
|
7
6
|
@max_mem_size = max_mem_size
|
8
|
-
@mem_mx_bean = ManagementFactory.getMemoryMXBean
|
9
|
-
super()
|
10
7
|
end
|
11
8
|
|
12
9
|
def over_threshold?
|
13
|
-
(
|
14
|
-
end
|
15
|
-
|
16
|
-
def pop
|
17
|
-
super()
|
18
|
-
@mem_mx_bean.gc
|
19
|
-
end
|
20
|
-
|
21
|
-
def delete(key)
|
22
|
-
super(key)
|
23
|
-
@mem_mx_bean.gc
|
10
|
+
ObjectSpace.memsize_of(@table) > @max_mem_size
|
24
11
|
end
|
25
12
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'lib/lru-cacher'
|
2
|
+
require 'java'
|
3
|
+
import java.lang.management.ManagementFactory
|
4
|
+
|
5
|
+
class MemoryLimitedJava < LRUCacher
|
6
|
+
def initialize(max_mem_size)
|
7
|
+
@max_mem_size = max_mem_size
|
8
|
+
@mem_mx_bean = ManagementFactory.getMemoryMXBean
|
9
|
+
super()
|
10
|
+
end
|
11
|
+
|
12
|
+
def over_threshold?
|
13
|
+
((@mem_mx_bean.heap_memory_usage.used + @mem_mx_bean.non_heap_memory_usage.used) / 1048576) > @max_mem_size
|
14
|
+
end
|
15
|
+
|
16
|
+
def pop
|
17
|
+
super()
|
18
|
+
# @mem_mx_bean.gc
|
19
|
+
end
|
20
|
+
|
21
|
+
def delete(key)
|
22
|
+
super(key)
|
23
|
+
# @mem_mx_bean.gc
|
24
|
+
end
|
25
|
+
end
|
data/lib/lru-cacher/version.rb
CHANGED
data/lib/lru-cacher.rb
CHANGED
@@ -24,17 +24,17 @@ class LRUCacher
|
|
24
24
|
def get(key)
|
25
25
|
current_node = @table[key]
|
26
26
|
if current_node
|
27
|
-
if @
|
28
|
-
@head = current_node.next_node
|
29
|
-
@tail.next_node = current_node
|
30
|
-
@tail = current_node
|
31
|
-
elsif @tail == current_node
|
27
|
+
if @tail == current_node
|
32
28
|
current_node
|
29
|
+
elsif @head == current_node
|
30
|
+
@head = current_node.next_node
|
31
|
+
@tail.next_node = current_node
|
32
|
+
@tail = current_node
|
33
33
|
else
|
34
34
|
current_node.prev_node.next_node = current_node.next_node
|
35
35
|
current_node.next_node.prev_node = current_node.prev_node
|
36
|
-
@tail.next_node
|
37
|
-
@tail
|
36
|
+
@tail.next_node = current_node
|
37
|
+
@tail = current_node
|
38
38
|
end
|
39
39
|
current_node
|
40
40
|
end
|
@@ -43,7 +43,9 @@ class LRUCacher
|
|
43
43
|
def delete(key)
|
44
44
|
current_node = @table[key]
|
45
45
|
if current_node
|
46
|
-
if @head == current_node
|
46
|
+
if @head == current_node && @tail == current_node
|
47
|
+
@head, @tail = nil
|
48
|
+
elsif @head == current_node
|
47
49
|
@head = current_node.next_node
|
48
50
|
elsif @tail == current_node
|
49
51
|
@tail = current_node.prev_node
|
@@ -58,7 +60,6 @@ class LRUCacher
|
|
58
60
|
end
|
59
61
|
|
60
62
|
|
61
|
-
|
62
63
|
# (0)
|
63
64
|
# nn ||
|
64
65
|
# V ||
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lru-cacher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manther
|
@@ -105,9 +105,9 @@ files:
|
|
105
105
|
- lib/lru-cacher.rb
|
106
106
|
- lib/lru-cacher/item_limited.rb
|
107
107
|
- lib/lru-cacher/memory_limited.rb
|
108
|
+
- lib/lru-cacher/memory_limited_java.rb
|
108
109
|
- lib/lru-cacher/node.rb
|
109
110
|
- lib/lru-cacher/version.rb
|
110
|
-
- lru-cacher-1.0.0.gem
|
111
111
|
- lru-cacher.gemspec
|
112
112
|
homepage: https://github.com/Manther/lru-cache
|
113
113
|
licenses:
|
data/lru-cacher-1.0.0.gem
DELETED
Binary file
|