text: /*
   *  The code is part of the Cocytus project
   *
   * Copyright (C) 2016 Institute of Parallel and Distributed Systems (IPADS), Shanghai Jiao Tong University
   *     All rights reserved.
   *
   *  Licensed under the Apache License, Version 2.0 (the "License");
   *  you may not use this file except in compliance with the License.
   *  You may obtain a copy of the License at
   *
   *  http://www.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an "AS IS" BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   *
   *  For more about this software, visit:  http://ipads.se.sjtu.edu.cn/pub/projects/cocytus
   *
   */
  #ifndef DEF_H
  #define DEF_H
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <assert.h>
  #include <stdint.h>
  
  typedef int int32_t;
  typedef unsigned int uint32_t;
  //typedef uint64_t ADDR;
  //typedef unsigned long long uint64_t;
  
  #ifndef NULL
  #define NULL (0)
  #endif
  
  static inline void* safe_malloc(unsigned long size)
  {
  	void *ret;
  	ret = malloc(size);
  	if (!ret) {
  		perror("malloc error");
  		exit(-1);
  	}
  	return ret;
  }
  
  #endif
  