Skip to content

Commit

Permalink
remove V8::AdjustAmountOfExternalAllocatedMemory (aka NanAdjustExtern…
Browse files Browse the repository at this point in the history
…alMemory) - closes #136
  • Loading branch information
Dane Springmeyer committed Jul 7, 2015
1 parent 1abd065 commit b7b1ec5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/mapnik_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,12 @@ void Grid::Initialize(Handle<Object> target) {

Grid::Grid(unsigned int width, unsigned int height, std::string const& key) :
node::ObjectWrap(),
this_(std::make_shared<mapnik::grid>(width,height,key)),
estimated_size_(width * height) {
NanAdjustExternalMemory(estimated_size_);
this_(std::make_shared<mapnik::grid>(width,height,key))
{
}

Grid::~Grid()
{
NanAdjustExternalMemory(-estimated_size_);
}

NAN_METHOD(Grid::New)
Expand Down
1 change: 0 additions & 1 deletion src/mapnik_grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class Grid: public node::ObjectWrap {
private:
~Grid();
grid_ptr this_;
int estimated_size_;
};

#endif
Expand Down
3 changes: 0 additions & 3 deletions src/mapnik_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,16 @@ Image::Image(unsigned int width, unsigned int height, mapnik::image_dtype type,
node::ObjectWrap(),
this_(std::make_shared<mapnik::image_any>(width,height,type,initialized,premultiplied,painted))
{
NanAdjustExternalMemory(this_->size());
}

Image::Image(image_ptr _this) :
node::ObjectWrap(),
this_(_this)
{
NanAdjustExternalMemory(this_->size());
}

Image::~Image()
{
NanAdjustExternalMemory(-this_->size());
}

NAN_METHOD(Image::New)
Expand Down

0 comments on commit b7b1ec5

Please sign in to comment.