see #7544, added RedisModule_HoldString api. (#7577)

Added RedisModule_HoldString that either returns a
shallow copy of the given String (by increasing
the String ref count) or a new deep copy of String
in case its not possible to get a shallow copy.

Co-authored-by: Itamar Haber <itamar@redislabs.com>
(cherry picked from commit 3f494cc49d)
This commit is contained in:
Meir Shpilraien (Spielrein)
2020-09-01 09:27:58 +03:00
committed by Oran Agra
parent e3cfc92180
commit 2fc915f509
4 changed files with 83 additions and 8 deletions
+6 -6
View File
@@ -11,12 +11,12 @@ tags "modules" {
r zadd t 1 f1 2 f2
r xadd s * f v
r debug reload
assert_equal 1 [r keyspace.is_key_loaded x]
assert_equal 1 [r keyspace.is_key_loaded y]
assert_equal 1 [r keyspace.is_key_loaded z]
assert_equal 1 [r keyspace.is_key_loaded p]
assert_equal 1 [r keyspace.is_key_loaded t]
assert_equal 1 [r keyspace.is_key_loaded s]
assert_equal {1 x} [r keyspace.is_key_loaded x]
assert_equal {1 y} [r keyspace.is_key_loaded y]
assert_equal {1 z} [r keyspace.is_key_loaded z]
assert_equal {1 p} [r keyspace.is_key_loaded p]
assert_equal {1 t} [r keyspace.is_key_loaded t]
assert_equal {1 s} [r keyspace.is_key_loaded s]
}
}
}