1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
16 #ifndef SQUIRRELJME_CLEANUP_H
17 #define SQUIRRELJME_CLEANUP_H
19 #include "sjme/nvm/nvm.h"
20 #include "sjme/alloc.h"
24 #ifndef SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_IS_EXTERNED
26 #define SJME_CXX_SQUIRRELJME_CLEANUP_H
29 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
30 #endif /* #ifdef __cplusplus */
32 /*--------------------------------------------------------------------------*/
35 * Allocates virtual machine structure type.
37 * @param inPool The pool to allocate within.
38 * @param allocSize The allocation size.
39 * @param inType The type of structure this is.
40 * @param outCommon The resultant common structure.
41 * @return On any resultant error, if any.
44 sjme_errorCode
sjme_nvm_allocR(
45 sjme_attrInNotNull sjme_alloc_pool
* inPool
,
46 sjme_attrInPositiveNonZero sjme_jint allocSize
,
47 sjme_attrInValue sjme_nvm_structType inType
,
48 sjme_attrOutNotNull sjme_nvm_common
* outCommon
49 SJME_DEBUG_ONLY_COMMA SJME_DEBUG_DECL_FILE_LINE_FUNC_OPTIONAL
);
52 * Allocates virtual machine structure type.
54 * @param inPool The pool to allocate within.
55 * @param allocSize The allocation size.
56 * @param inType The type of structure this is.
57 * @param outCommon The resultant common structure.
58 * @return On any resultant error, if any.
61 #define sjme_nvm_alloc(inPool, allocSize, refCounting, outCommon) \
62 (sjme_nvm_allocR((inPool), (allocSize), (refCounting), \
63 (outCommon) SJME_DEBUG_ONLY_COMMA SJME_DEBUG_FILE_LINE_FUNC_OPTIONAL))
65 /*--------------------------------------------------------------------------*/
69 #ifdef SJME_CXX_SQUIRRELJME_CLEANUP_H
71 #undef SJME_CXX_SQUIRRELJME_CLEANUP_H
72 #undef SJME_CXX_IS_EXTERNED
73 #endif /* #ifdef SJME_CXX_SQUIRRELJME_CLEANUP_H */
74 #endif /* #ifdef __cplusplus */
76 #endif /* SQUIRRELJME_CLEANUP_H */