Stagger each user argument value so we can detect mismatched * indices. * * For example, say a plugin associates data with both sessions and * transactions and that its session index is 2 and its transaction index is 4. * In this case, we'll hand back to the plugin 2002 for its session index and * 1004 for its transaction index. If it then accidentally uses its session * index to reference
| 54 | * That is, for a transaction, expect internally a value of 3 instead of 1003. |
| 55 | */ |
| 56 | static constexpr size_t |
| 57 | get_user_arg_offset(TSUserArgType type) |
| 58 | { |
| 59 | // TS_USER_ARGS_TXN indices begin at 1000, TS_USER_ARGS_SSN begin at 2000, |
| 60 | // etc. |
| 61 | return (static_cast<size_t>(type) + 1) * 1000; |
| 62 | } |
| 63 | |
| 64 | /** Verify that the user passed in an index whose value corresponds with the |
| 65 | * type. See the comment above the declaration of get_user_arg_offset for the |
no outgoing calls
no test coverage detected