mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-07 05:34:59 -05:00
I tried to adjust my heap to FreeRTOS. This is my very first commit to FreeRTOS, i don't even know how to compile the kernel. Maybe You get it running and let me know what You think about it. https://forums.freertos.org/t/real-time-memory-manager/19685
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
//================
|
|
// parent_group.h
|
|
//================
|
|
|
|
// Shared functions for block_map and offset_index.
|
|
|
|
// Copyright 2024, Sven Bieg (svenbieg@web.de)
|
|
// http://github.com/svenbieg/Heap
|
|
|
|
|
|
#ifndef _PARENT_GROUP_H
|
|
#define _PARENT_GROUP_H
|
|
|
|
|
|
//=======
|
|
// Using
|
|
//=======
|
|
|
|
#include <heap.h>
|
|
#include "cluster_group.h"
|
|
|
|
|
|
//==============
|
|
// Parent-Group
|
|
//==============
|
|
|
|
typedef struct
|
|
{
|
|
cluster_group_t header;
|
|
size_t item_count;
|
|
size_t first;
|
|
size_t last;
|
|
cluster_group_t* children[CLUSTER_GROUP_SIZE];
|
|
}parent_group_t;
|
|
|
|
|
|
//========
|
|
// Access
|
|
//========
|
|
|
|
uint16_t parent_group_get_group(parent_group_t* group, size_t* at);
|
|
int16_t parent_group_get_nearest_space(parent_group_t* group, int16_t pos);
|
|
|
|
|
|
//==============
|
|
// Modification
|
|
//==============
|
|
|
|
void parent_group_append_groups(parent_group_t* group, cluster_group_t* const* append, uint16_t count);
|
|
void parent_group_insert_groups(parent_group_t* group, uint16_t at, cluster_group_t* const* insert, uint16_t count);
|
|
void parent_group_remove_group(heap_handle_t heap, parent_group_t* group, uint16_t at);
|
|
void parent_group_remove_groups(parent_group_t* group, uint16_t at, uint16_t count);
|
|
|
|
#endif // _PARENT_GROUP_H
|