Skip to content

Commit

Permalink
debug stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Kroll committed Feb 18, 2015
1 parent 0584cf4 commit 446ce10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ ifeq ($(USE_MMAP_POOL),1)
CCFLAGS+=-DUSE_MMAP_POOL
endif

ifeq ($(DEBUG_COMMANDS),1)
CCFLAGS+=-DDEBUG_COMMANDS
endif

all: Release Debug

Release: graphcore
Expand Down
4 changes: 4 additions & 0 deletions src/mmap_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,10 @@ class singlepage_std_allocator: public std::allocator<T>
//~ printf("allocate n=%zu sizeof(T)=%zu typeid(T)=%s\n", n, sizeof(T), typeid(T).name());

if(n*sizeof(T)!=FixedsizeAllocator::BlockSize)
{
dmsg("singlepage_allocator::allocate(): n*sizeof(T)!=BlockSize (n=%d)\n", n);
return static_cast<T*>(::operator new(n*sizeof(T)));
}

return (pointer)getAllocator().allocate(1);
}
Expand Down Expand Up @@ -558,6 +561,7 @@ class singlepage_std_allocator: public std::allocator<T>

if(n*sizeof(T)!=FixedsizeAllocator::BlockSize)
{
dmsg("singlepage_allocator::deallocate(): n*sizeof(T)!=BlockSize (n=%d)\n", n);
::operator delete(p);
return;
}
Expand Down

0 comments on commit 446ce10

Please sign in to comment.