Path: blob/master/yabause/src/dreamcast/sh2rec/sh2rec_mem.h
2 views
/* Copyright 2010 Lawrence Sebald12This file is part of Yabause.34Yabause is free software; you can redistribute it and/or modify5it under the terms of the GNU General Public License as published by6the Free Software Foundation; either version 2 of the License, or7(at your option) any later version.89Yabause is distributed in the hope that it will be useful,10but WITHOUT ANY WARRANTY; without even the implied warranty of11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12GNU General Public License for more details.1314You should have received a copy of the GNU General Public License15along with Yabause; if not, write to the Free Software16Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA17*/1819#ifndef SH2REC_MEM_H20#define SH2REC_MEM_H2122/* Initial allocation of memory: 1MB */23#define SH2REC_MEM_INITIAL (1024 * 1024)2425/* Size of future allocations: 256KB */26#define SH2REC_MEM_ALLOCSZ (256 * 1024)2728/* Maximum allocation of memory: 2MB */29#define SH2REC_MEM_MAX (2 * 1024 * 1024)3031/* Fudge factor... make sure at least this much is in any block above the32inital request */33#define SH2REC_MEM_FUDGE 483435int sh2rec_mem_init(void);36void sh2rec_mem_shutdown(void);3738void *sh2rec_mem_alloc(int sz);39int sh2rec_mem_expand(void *block, int amt);40void sh2rec_mem_free(void *block);4142#endif /* !SH2REC_MEM_H */434445