summaryrefslogtreecommitdiff
path: root/src/module.c
Commit message (Collapse)AuthorAgeFilesLines
* Modules: fixes to the blocking commands API: examples now works.antirez2016-10-071-2/+10
|
* Modules: RM_Milliseconds() API added.antirez2016-10-071-0/+6
|
* Modules: blocking commands WIP: API exported, a first example.antirez2016-10-071-2/+21
|
* Module: API to block clients with threading support.antirez2016-10-071-10/+166
| | | | Just a draft to align the main ideas, never executed code. Compiles.
* Module: Ability to get context from IO context.antirez2016-10-061-0/+15
| | | | | | | | | | | | | | | | | | | It was noted by @dvirsky that it is not possible to use string functions when writing the AOF file. This sometimes is critical since the command rewriting may need to be built in the context of the AOF callback, and without access to the context, and the limited types that the AOF production functions will accept, this can be an issue. Moreover there are other needs that we can't anticipate regarding the ability to use Redis Modules APIs using the context in order to build representations to emit AOF / RDB. Because of this a new API was added that allows the user to get a temporary context from the IO context. The context is auto released if obtained when the RDB / AOF callback returns. Calling multiple time the function to get the context, always returns the same one, since it is invalid to have more than a single context.
* Copyright notice added to module.c.antirez2016-10-061-0/+29
|
* Modules: API to save/load single precision floating point numbers.antirez2016-10-031-0/+27
| | | | | When double precision is not needed, to take 2x space in the serialization is not good.
* Modules: API to log from module I/O callbacks.antirez2016-10-021-16/+38
|
* added RM_CreateStringPrintfDvir Volk2016-09-211-2/+23
|
* dict.c: introduce dictUnlink().oranagra2016-09-141-1/+2
| | | | | | | | | | | | | | | | | | | | Notes by @antirez: This patch was picked from a larger commit by Oran and adapted to change the API a bit. The basic idea is to avoid double lookups when there is to use the value of the deleted entry. BEFORE: entry = dictFind( ... ); /* 1st lookup. */ /* Do somethjing with the entry. */ dictDelete(...); /* 2nd lookup. */ AFTER: entry = dictUnlink( ... ); /* 1st lookup. */ /* Do somethjing with the entry. */ dictFreeUnlinkedEntry(entry); /* No lookups!. */
* fix memory error on module unloadwyx2016-09-091-1/+1
|
* Modules: handle NULL replies more gracefully.antirez2016-08-031-0/+6
| | | | | After all crashing at every API misuse makes everybody's life more complex.
* Modules: initial draft for a testing module.antirez2016-08-031-93/+108
|
* Modules: StringAppendBuffer() and ability to retain strings.antirez2016-08-021-4/+81
| | | | | | | | | | | | | RedisModule_StringRetain() allows, when automatic memory management is on, to keep string objects living after the callback returns. Can also be used in order to use Redis reference counting of objects inside modules. The reason why this is useful is that sometimes when implementing new data types we want to reference RedisModuleString objects inside the module private data structures, so those string objects must be valid after the callback returns even if not referenced inside the Redis key space.
* Merge pull request #3335 from dvirsky/rm_callocSalvatore Sanfilippo2016-06-231-1/+10
|\ | | | | added RM_Calloc implementation
| * added RM_Calloc implementationDvir Volk2016-06-221-1/+10
| |
* | Merge branch 'unstable' of github.com:/antirez/redis into unstableantirez2016-06-231-0/+12
|\ \
| * \ Merge pull request #3336 from yossigo/create_string_from_stringSalvatore Sanfilippo2016-06-231-0/+12
| |\ \ | | | | | | | | Add RedisModule_CreateStringFromString().
| | * | Add RedisModule_CreateStringFromString().Yossi Gottlieb2016-06-221-0/+12
| | |/
* | | Actually remove static from #3331.antirez2016-06-231-2/+1
|/ / | | | | | | I forgot -a when amending in the previous commit.
* | Minor change to conform PR #3331 to Redis code base style.antirez2016-06-231-2/+1
| | | | | | | | Also avoid "static" in order to have symbols during crashes.
* | Merge pull request #3331 from yossigo/fix_openkey_crashSalvatore Sanfilippo2016-06-231-6/+13
|\ \ | | | | | | Fix occasional RM_OpenKey() crashes.
| * | Cleanup: remove zset reset function from RM_ZsetRangeStop().Yossi Gottlieb2016-06-221-7/+13
| | |
| * | Fix occasional RM_OpenKey() crashes.Yossi Gottlieb2016-06-211-0/+1
| |/
* | Merge pull request #3330 from yossigo/fix_constSalvatore Sanfilippo2016-06-231-3/+3
|\ \ | | | | | | Use const in Redis Module API where possible.
| * | Use const in Redis Module API where possible.Yossi Gottlieb2016-06-201-3/+3
| |/
* | Modules: changes to logging function.antirez2016-06-231-6/+23
| | | | | | | | | | | | | | | | | | | | | | This commit changes what provided by PR #3315 (merged) in order to let the user specify the log level as a string. The define could be also used, but when this happens, they must be decoupled from the defines in the Redis core, like in the other part of the Redis modules implementations, so that a switch statement (or a function) remaps between the two, otherwise we are no longer free to change the internal Redis defines.
* | Add RedisModule_Log() logging API function.Yossi Gottlieb2016-06-231-0/+25
| |
* | Commit change in autoMemoryFreed(): first -> last.antirez2016-06-231-1/+2
| | | | | | | | | | It's more natural to call the last entry added as "last", the original commet got me confused until I actually read the code.
* | Modules: implement zig-zag scanning in autoMemoryFreed().antirez2016-06-231-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | Most of the time to check the last element is the way to go, however there are patterns where the contrary is the best choice. Zig-zag scanning implemented in this commmit always checks the obvious element first (the last added -- think at a loop where the last element allocated gets freed again and again), and continues checking one element in the head and one in the tail. Thanks to @dvisrky that fixed the original implementation of the function and proposed zig zag scanning.
* | Merge pull request #3244 from dvirsky/optimize_autoMemoryFreedSalvatore Sanfilippo2016-06-231-4/+12
|\ \ | |/ |/| Optimized autoMemoryFreed loop
| * optimized amFree even furtherDvir Volk2016-05-191-4/+9
| |
| * Optimized autoMemoryFreed loopDvir Volk2016-05-191-1/+4
| |
* | Free module context after loading.antirez2016-06-131-0/+1
| | | | | | | | | | | | | | | | Now that modules receive RedisModuleString objects on loading, they are allowed to call the String API, so the context must be released correctly. Related to #3293.
* | Minor changes to unifor C style to Redis code base for PR #3293.antirez2016-06-131-2/+4
| |
* | Merge pull request #3293 from yossigo/module_configSalvatore Sanfilippo2016-06-131-10/+18
|\ \ | | | | | | Allow passing arguments to modules on load.
| * | Use RedisModuleString for OnLoad argv.Yossi Gottlieb2016-06-051-8/+2
| | |
| * | Allow passing arguments to modules on load.Yossi Gottlieb2016-06-051-10/+24
| | |
* | | Fix MODULE UNLOAD crash and/or wrong error message.Yossi Gottlieb2016-06-051-7/+14
|/ /
* | Modules: support for modules native data types.antirez2016-06-031-4/+505
|/
* Modules: RM_HashSet() SDS ownership business clarified in comments.antirez2016-05-181-5/+5
| | | | Related to #3239.
* fixed bad transfer of ownership in HashSet causing a potential crashDvir Volk2016-05-171-4/+7
|
* Modules: initial pool allocator and a LEFTPAD usage example.antirez2016-05-141-4/+88
|
* Modules: doc layout improved.antirez2016-05-101-21/+21
|
* RM_ZsetRangeNext()/Prev() typo in define name leading to crash fixed.antirez2016-05-101-2/+2
|
* Modules: commandFlagsFromString() top comment back to 80 cols max.antirez2016-05-101-24/+29
|
* Trailing spaces removed from moduleCreateArgvFromUserFormat().antirez2016-05-101-4/+4
|
* Modules: RM_GetClientId() implemented.antirez2016-05-101-0/+17
|
* fixed crash when calling CreateStringFromCallReply on array elementsDvir Volk2016-05-101-0/+1
|
* Avoids reallocating and double String on truncateItamar Haber2016-05-101-18/+17
|