Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
156029b3
Commit
156029b3
authored
Jul 18, 2014
by
antirez
Browse files
Test: small integer sharing depends on maxmemory policy.
parent
06e9b3ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/maxmemory.tcl
View file @
156029b3
start_server
{
tags
{
"maxmemory"
}}
{
start_server
{
tags
{
"maxmemory"
}}
{
test
"Without maxmemory small integers are shared"
{
r config set maxmemory 0
r set a 1
assert
{[
r object refcount a
]
> 1
}
}
test
"With maxmemory and non-LRU policy integers are still shared"
{
r config set maxmemory 1073741824
r config set maxmemory-policy allkeys-random
r set a 1
assert
{[
r object refcount a
]
> 1
}
}
test
"With maxmemory and LRU policy integers are not shared"
{
r config set maxmemory 1073741824
r config set maxmemory-policy allkeys-lru
r set a 1
r config set maxmemory-policy volatile-lru
r set b 1
assert
{[
r object refcount a
]
== 1
}
assert
{[
r object refcount b
]
== 1
}
r config set maxmemory 0
}
foreach policy
{
foreach policy
{
allkeys-random allkeys-lru volatile-lru volatile-random volatile-ttl
allkeys-random allkeys-lru volatile-lru volatile-random volatile-ttl
}
{
}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment