Add API callback for tracking allocated memory
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 3 Sep 2010 11:31:58 +0000 (11:31 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 3 Sep 2010 11:31:58 +0000 (11:31 +0000)
commitd3e457303e3156de8aab9627ac8e7d4505932c19
tree977af49da512d9e5916063f2b05aa08aa276e2ea
parent2b1e4560e73aabac2695e0c93671fe2d661e223b
Add API callback for tracking allocated memory

Allows the host application to provide a mechanism for notification and custom logging through a callback (set through the API V8::AddMemoryAllocationCallback and removed through V8::RemoveMemoryAllocationCallback), when V8 allocates ro frees memory.

This replaces the current histogram data "V8.ExecutableMemoryMax" by allowing usage data to be logged by the application as required rather than always through V8.

BUG=http://crbug.com/54222
TEST=Set the callback function with the API and cause V8 to allocate memory.

Patch by Paul Mehta <pmehta@chromium.org>

Review URL: http://codereview.chromium.org/3329006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5403 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
include/v8.h
src/api.cc
src/d8.cc
src/spaces.cc
src/spaces.h