Use safe_malloc instead of new when creating new_envoy_map_entry#2632
Conversation
…e release_envoy_map uses free instead of delete Signed-off-by: Ryan Hamilton <rch@google.com>
…e release_envoy_map uses free instead of delete Signed-off-by: Ryan Hamilton <rch@google.com>
|
/assign @snowp |
|
@snowp I sent this your way based on the Obj-C/C/C++ discussion we had on Slack. Feel free to redirect though! |
snowp
left a comment
There was a problem hiding this comment.
Nice this makes sense to me, one suggestion
Is this check something we can enable for the EM build? Or is this some internal secret sauce?
| envoy_map_entry* header_array = | ||
| static_cast<envoy_map_entry*>(safe_malloc(sizeof(envoy_map_entry) * 0)); |
There was a problem hiding this comment.
Maybe use makeEnvoyMap here? Would be nice to keep the init logic in one place
There was a problem hiding this comment.
Good question! I was able to do this for both this test and the subsequent one. The rest of the tests, though, seem more elaborate. They set up envoy_map instances in which the envoy_data is wired up to use envoy_test_release() when releasing the data to do tracking. makeEnvoyMap seems to use copyToBridgeData() to populate the map which I think makes this a non-starter. But I'm not entirely familiar with this code so maybe there's a cleaner approach?
Signed-off-by: Ryan Hamilton <rch@google.com>
Interesting question. It does look like an internal secret sauce thing in tcmalloc, according to some internal docs. However, the chromium version of tcmalloco has something basically similar. There error comes from here: So it might be something to investigate, but i don't think it works out of the box. |
|
/retest |
Signed-off-by: Ryan Hamilton <rch@google.com>
…builder-function * origin/main: remove the use of deprecated flag (#2658) Cronvoy: Map EM Errors to Cronet API Errors II (#1594) (#2633) build: revert boring patch (#2651) Bump Lyft Support Rotation (#2654) fix one issue blocking bumping Envoy (#2649) ci: remove Snow from Lyft EM rotation (#2650) ci: increasing timeouts (#2653) python: Apply Envoy python-yapf formatting (#2648) repo: Shellcheck cleanups (#2646) repo: Switch `pip_install` -> `pip_parse` (#2647) Use safe_malloc instead of new when creating new_envoy_map_entry (#2632) python: Pin requirement hashes (#2643) Disable flaky TestConfig.StringAccessors (#2642) ci: migrate from set-output to GITHUB_OUTPUT (#2625) Add a comment to addPlatformFilter (#2634) Allow Cronvoy to build with proguard. (#2635) Update Envoy (#2630) Add support for Platform and Native filters to C++ EngineBuilder (#2626) Register getaddrinfo in extension_registry (#2627) dns: stop using cares DNS resolver (#2618) Signed-off-by: JP Simard <jp@jpsim.com>
Use safe_malloc instead of new when creating new_envoy_map_entry
since release_envoy_map uses free instead of delete. Found when
building this code internally with some sort of strict checking enabled
Signed-off-by: Ryan Hamilton rch@google.com
Risk Level: Low
Testing: Existing tests
Docs Changes: N/A
Release Notes: N/A