OSDN Git Service

Add memory canaries and turn them on for unit tests
authorZach Johnson <zachoverflow@google.com>
Thu, 28 Aug 2014 20:30:17 +0000 (13:30 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Mon, 16 Mar 2015 23:51:31 +0000 (16:51 -0700)
commitf947fdddf5de6bd30886688a2b399460a3d95ecc
tree4d8982e1e64081aa235d188e9f011c1e8fd904a9
parent4eb14ed2eab174998a86ad245d8163d9f03d3c68
Add memory canaries and turn them on for unit tests

This will allow us to verify with resonable certainty
that the code is not writing past the end or beginning
of the memory allocation that it was given.

With canaries on, the canaried pointers returned by the
osi alloc functions are no longer passable directly to
free, since they must be offset to get the real allocation
pointers. This means all legacy code must be converted
over to the osi alloc functions before turning canaries
on in the wider codebase.
osi/include/allocation_tracker.h
osi/src/allocation_tracker.c
osi/src/allocator.c
osi/test/AllocationTestHarness.cpp
osi/test/allocation_tracker_test.cpp