src/core/alloc_func.hpp
author peter1138
Tue, 22 Jan 2008 20:04:30 +0000
changeset 8877 add4fac0828d
parent 8872 dd23eb1922b6
child 9033 7153b87990f8
permissions -rw-r--r--
(svn r11949) -Codechange: add river icon and cursor, drawn by skidd13.
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
     1
/* $Id$ */
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
     2
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
     3
/** @file alloc_func.hpp Functions related to the allocation of memory */
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6482
diff changeset
     4
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
     5
#ifndef ALLOC_FUNC_HPP
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
     6
#define ALLOC_FUNC_HPP
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
     7
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
     8
/**
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
     9
 * Simplified allocation function that allocates the specified number of
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    10
 * elements of the given type. It also explicitly casts it to the requested
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    11
 * type.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    12
 * @note throws an error when there is no memory anymore.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    13
 * @note the memory contains garbage data (i.e. possibly non-zero values).
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    14
 * @param T the type of the variable(s) to allocation.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    15
 * @param num_elements the number of elements to allocate of the given type.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    16
 * @return NULL when num_elements == 0, non-NULL otherwise.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    17
 */
5860
7fdc9b423ba1 (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
KUDr
parents: 5838
diff changeset
    18
template <typename T> FORCEINLINE T* MallocT(size_t num_elements)
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
    19
{
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    20
	/*
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    21
	 * MorphOS cannot handle 0 elements allocations, or rather that always
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    22
	 * returns NULL. So we do that for *all* allocations, thus causing it
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    23
	 * to behave the same on all OSes.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    24
	 */
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    25
	if (num_elements == 0) return NULL;
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    26
5860
7fdc9b423ba1 (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
KUDr
parents: 5838
diff changeset
    27
	T *t_ptr = (T*)malloc(num_elements * sizeof(T));
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    28
	if (t_ptr == NULL) error("Out of memory. Cannot allocate %i bytes", num_elements * sizeof(T));
5860
7fdc9b423ba1 (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
KUDr
parents: 5838
diff changeset
    29
	return t_ptr;
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
    30
}
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
    31
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    32
/**
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    33
 * Simplified allocation function that allocates the specified number of
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    34
 * elements of the given type. It also explicitly casts it to the requested
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    35
 * type.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    36
 * @note throws an error when there is no memory anymore.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    37
 * @note the memory contains all zero values.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    38
 * @param T the type of the variable(s) to allocation.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    39
 * @param num_elements the number of elements to allocate of the given type.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    40
 * @return NULL when num_elements == 0, non-NULL otherwise.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    41
 */
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    42
template <typename T> FORCEINLINE T* CallocT(size_t num_elements)
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    43
{
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    44
	/*
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    45
	 * MorphOS cannot handle 0 elements allocations, or rather that always
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    46
	 * returns NULL. So we do that for *all* allocations, thus causing it
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    47
	 * to behave the same on all OSes.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    48
	 */
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    49
	if (num_elements == 0) return NULL;
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
    50
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    51
	T *t_ptr = (T*)calloc(num_elements, sizeof(T));
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    52
	if (t_ptr == NULL) error("Out of memory. Cannot allocate %i bytes", num_elements * sizeof(T));
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    53
	return t_ptr;
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
    54
}
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
diff changeset
    55
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    56
/**
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    57
 * Simplified reallocation function that allocates the specified number of
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    58
 * elements of the given type. It also explicitly casts it to the requested
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    59
 * type. It extends/shrinks the memory allocation given in t_ptr.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    60
 * @note throws an error when there is no memory anymore.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    61
 * @note the memory contains all zero values.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    62
 * @param T the type of the variable(s) to allocation.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    63
 * @param t_ptr the previous allocation to extend/shrink.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    64
 * @param num_elements the number of elements to allocate of the given type.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    65
 * @return NULL when num_elements == 0, non-NULL otherwise.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    66
 */
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    67
template <typename T> FORCEINLINE T* ReallocT(T *t_ptr, size_t num_elements)
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    68
{
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    69
	/*
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    70
	 * MorphOS cannot handle 0 elements allocations, or rather that always
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    71
	 * returns NULL. So we do that for *all* allocations, thus causing it
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    72
	 * to behave the same on all OSes.
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    73
	 */
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    74
	if (num_elements == 0) {
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    75
		free(t_ptr);
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    76
		return NULL;
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    77
	}
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    78
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    79
	t_ptr = (T*)realloc(t_ptr, num_elements * sizeof(T));
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    80
	if (t_ptr == NULL) error("Out of memory. Cannot reallocate %i bytes", num_elements * sizeof(T));
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    81
	return t_ptr;
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    82
}
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
    83
8872
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    84
/**
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    85
 * A small 'wrapper' for allocations that can be done on most OSes on the
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    86
 * stack, but are just too large to fit in the stack on devices with a small
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    87
 * stack such as the NDS.
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    88
 * So when it is possible a stack allocation is made, otherwise a heap
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    89
 * allocation is made and this is freed once the struct goes out of scope.
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    90
 * @param T      the type to make the allocation for
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    91
 * @param length the amount of items to allocate
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    92
 */
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    93
template <typename T, size_t length>
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    94
struct SmallStackSafeStackAlloc {
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    95
#if !defined(__NDS__)
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    96
	/** Storing the data on the stack */
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    97
	T data[length];
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    98
#else
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
    99
	/** Storing it on the heap */
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   100
	T *data;
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   101
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   102
	/** Allocating the memory */
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   103
	SmallStackSafeStackAlloc() : data(MallocT<T>(length)) {}
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   104
	/** And freeing when it goes out of scope */
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   105
	~SmallStackSafeStackAlloc() { free(data); }
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   106
#endif
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   107
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   108
	/**
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   109
	 * Gets a pointer to the data stored in this wrapper.
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   110
	 * @return the pointer.
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   111
	 */
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   112
	operator T* () { return data; }
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   113
};
dd23eb1922b6 (svn r11943) -Codechange: add and use a simple structure to support small stacks by allocating it on the heap or pushing a few kB of data onto the stack when there is a large stack.
rubidium
parents: 8626
diff changeset
   114
8626
440dfcd14c4a (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed.
rubidium
parents: 8608
diff changeset
   115
#endif /* ALLOC_FUNC_HPP */