Skip to content

snRuntime/api/alloc_decls.h

Classes

Name
struct snrt_allocator_t

Functions

Name
void * snrt_l1_next()
void * snrt_l3_next()
void * snrt_l1alloc(size_t size)
Allocate a chunk of memory in the L1 memory.
void snrt_l1_update_next(void * next)
Override the L1 allocator next pointer.
void * snrt_l3alloc(size_t size)
Allocate a chunk of memory in the L3 memory.
void snrt_alloc_init()

Functions Documentation

function snrt_l1_next

inline void * snrt_l1_next()

function snrt_l3_next

inline void * snrt_l3_next()

function snrt_l1alloc

inline void * snrt_l1alloc(
    size_t size
)

Allocate a chunk of memory in the L1 memory.

Parameters:

  • size number of bytes to allocate

Return: pointer to the allocated memory

This currently does not support free-ing of memory

function snrt_l1_update_next

inline void snrt_l1_update_next(
    void * next
)

Override the L1 allocator next pointer.

function snrt_l3alloc

inline void * snrt_l3alloc(
    size_t size
)

Allocate a chunk of memory in the L3 memory.

Parameters:

  • size number of bytes to allocate

Return: pointer to the allocated memory

This currently does not support free-ing of memory

function snrt_alloc_init

inline void snrt_alloc_init()

Source code

// Copyright 2023 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

typedef struct {
    // Base address from where allocation starts
    uint32_t base;
    // Number of bytes alloctable
    uint32_t size;
    // Address of the next allocated block
    uint32_t next;
} snrt_allocator_t;

inline void *snrt_l1_next();

inline void *snrt_l3_next();

inline void *snrt_l1alloc(size_t size);

inline void snrt_l1_update_next(void *next);

inline void *snrt_l3alloc(size_t size);

inline void snrt_alloc_init();

Updated on 2023-06-19 at 09:43:56 +0000