WL#9468: Improve string usage in DD code
Affects: Server-8.0 — Status: Complete
Incrementally improve the usage of strings in the DD code. Currently the DD code makes extensive use of std::string, which is safe (compared to const char *), but allocates directly on the system heap (bypasses performance schema instrumentation) and may throw exceptions. User Documentation ================== Code cleanup. No user documentation required.
Changes will be done incrementally in the following stages (more stages may be added later): 1. Introduce a typedef dd::string_type for all string usage in the DD code. Initially this typedef will be an alias for std::string. This will simplify the process of trying out different string implementations. 2. Create a template for a stateless allocator which can be instantiated with closures that use different performance schema memory keys. (Since the PFS key not a compile time constant, it cannot be given directly as a template argument, but must be provided by a closure or callable type). 3. Create a PFS key for DD string usage. 4. Change the typedef in 1. to an instantiation of std::basic_string using the allocator from 2.
Copyright (c) 2000, 2021, Oracle Corporation and/or its affiliates. All rights reserved.