Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Discussion about allocating memory from within an irq #896

Open
@dhylands

Description

@dhylands

So I've been thinkng about this, and I think it would be possible to have some type of scratch allocator which could be used inside interrupt handlers.

The actual scratch buffer would be allocated outside of the interrupt and somehow associated with the handler.

When the handler runs it would put the registered handler on top of a list of allocators. When a memory allocation is required, it would either use the scratch allocator, or if none were present, use the heap allocator. The scrath allocator would basically just increment a pointer by the number of bytes being allocated, as long as that number of bytes still exists in the scratch buffer,

Each time the interrupt fires, it would reset the scratch buffer.

I just thought I'd throw this out as an idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    portsRelates to multiple ports, or a new/proposed portrfcRequest for Comment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions