Summary: | Unneeded invocations of memcpy() | ||
---|---|---|---|
Product: | cairo | Reporter: | Steve Snyder <fdt0317.20.swsnyder> |
Component: | general | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED FIXED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | freedesktop |
Version: | 1.10.3 | ||
Hardware: | x86 (IA32) | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Skip zero-byte-length call to memcpy() |
Description
Steve Snyder
2011-06-01 14:37:54 UTC
I'd patch _cairo_path_buf_add_points() instead. (In reply to comment #1) > I'd patch _cairo_path_buf_add_points() instead. But the entirety of _cairo_path_buf_add_points() (which is little more than a wrapper around memcpy) is pointless if the num_points variable is zero. Sure, but why should the caller bother checking when the callee can do? commit 1ce5d4707cf260618bd4d61f39aad4371ffa3336 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Sep 16 16:11:42 2011 +0100 path: Skip calls to zero-length memcpy We attempt to copy 0 points onto the array of path points for a close-path. This is pointless and an unnecessary function call under MSVC at least. Based on a patch by Steve Snyder, incorporating Behdad's review comments. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37836 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.