 }
 
 void freeHostMem(void *p) {
-  int bytes;
+  size_t bytes;
   assert(is_init);
 #ifdef NO_OPT
   cudaFreeHost(p);

    free_list_host.clear();
  }

  static int num_resurrections=0, num_morecore=0;

  typedef cudaError (*mallocfn_t)(void **ptr, size_t bytes);
  static void *morecore(mallocfn_t fn, size_t bytes) {


extern "C" {

static size_t is_init=0;

  static map<size_t,set<void*> > free_list_gpu, free_list_host;
  static map<void *,size_t> live_ptrs_gpu, live_ptrs_host;

  static void clearGpuFreeList() {
    for(map<size_t,set<void*> >::iterator it=free_list_gpu.begin(); 
	it!=free_list_gpu.end(); ++it) {
      for(set<void*>::iterator it2=it->second.begin();
	  it2!=it->second.end(); ++it2) {
