#ifndef __MEMORY_H__ #define __MEMORY_H__ extern char* const scratchpad; // Starting address of scratchpad memory /** * @brief Allocate memory in the fast scratchpad RAM buffer. * * @param scratch_offset Pointer to a variable holding the current offset position in scratch memory. * @param size The number of bytes to allocate. Be aware that the scratchpad memory only has 1024 bytes available. * @return Pointer to the allocated buffer in scratchpad memory. */ void *mem_scratch(char **scratch_offset, unsigned short size); /** * @brief Allocate a single primitive in the primitive buffer. * * @param size Size of the primitive struct to allocate. * @return Pointer to the allocated struct in memory. */ void *mem_prim(size_t size); void mem_prim_reset(int db); #endif // __MEMORY_H__