diff options
author | Bert Belder <bertbelder@gmail.com> | 2012-04-11 22:02:12 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2012-04-11 22:02:12 +0200 |
commit | 3ec84a11f8ce70bde3a480a80cbe0875f8ea08ae (patch) | |
tree | 3c1f916907cc1c1c2881da10f4b07faeac6d569c /src/slab_allocator.cc | |
parent | 9b7a6c523821f02ee85616160c56f7b6ffeddf7d (diff) | |
download | node-new-3ec84a11f8ce70bde3a480a80cbe0875f8ea08ae.tar.gz |
Slab allocator: don't attempt to shrink a non-buffer
Diffstat (limited to 'src/slab_allocator.cc')
-rw-r--r-- | src/slab_allocator.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/slab_allocator.cc b/src/slab_allocator.cc index 504557a555..45daf621a9 100644 --- a/src/slab_allocator.cc +++ b/src/slab_allocator.cc @@ -116,7 +116,8 @@ Local<Object> SlabAllocator::Shrink(Handle<Object> obj, assert(!slab_v.IsEmpty()); assert(slab_v->IsObject()); Local<Object> slab = slab_v->ToObject(); - if (ptr && ptr == last_ptr_) { + assert(ptr != NULL); + if (ptr == last_ptr_) { last_ptr_ = NULL; offset_ = ptr - Buffer::Data(slab) + ROUND_UP(size, 16); } |