Fix evnet_buf size calculation for V8::AdjustAmountOfExternalAllocatedMemory().

v0.7.4-release
Ryan 2009-07-23 18:36:28 +02:00
parent dd1750f573
commit 646829262f
1 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,8 @@ using namespace std;
static void
buf_free (evnet_buf *b)
{
V8::AdjustAmountOfExternalAllocatedMemory(-b->len);
size_t total = sizeof(evnet_buf) + b->len;
V8::AdjustAmountOfExternalAllocatedMemory(-total);
free(b);
}