diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
| commit | 959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch) | |
| tree | acc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/db/pipeline/javascript_execution.h | |
| parent | 76588293975fc059cf076779e4283e6ffaf8afff (diff) | |
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/db/pipeline/javascript_execution.h')
| -rw-r--r-- | src/mongo/db/pipeline/javascript_execution.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/javascript_execution.h b/src/mongo/db/pipeline/javascript_execution.h index d95e90f6eea..a66dee6c6ca 100644 --- a/src/mongo/db/pipeline/javascript_execution.h +++ b/src/mongo/db/pipeline/javascript_execution.h @@ -58,6 +58,15 @@ public: StringData database, bool loadStoredProcedures, boost::optional<int> jsHeapLimitMB); + + /** + * Gets a pointer to the cached JsExecution instance if it exists, else returns nullptr. This + * allows the caller to skip passing all the arguments to the more general JsExecution::get() + * method, which avoids having to potentially construct and create a heap copy of a large scope + * object that will not be used because a cached JsExecution object already exists. + */ + static JsExecution* getCached(OperationContext* opCtx, bool loadStoredProcedures); + /** * Construct with a thread-local scope and initialize with the given scope variables. */ |
