Skip to content

Commit

Permalink
rebase #2
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe44 committed Nov 4, 2021
1 parent 417ef24 commit 1f1b286
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions components/heap/heap_tlsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,22 @@ typedef struct control_t
{
/* Empty lists point at this block to indicate they are free. */
block_header_t block_null;

/* Local parameter for the pool */
unsigned int fl_index_count;
unsigned int fl_index_shift;
unsigned int fl_index_max;
unsigned int sl_index_count;
unsigned int sl_index_count_log2;
unsigned int small_block_size;
size_t size;

/* Bitmaps for free lists. */
unsigned int fl_bitmap;
unsigned int sl_bitmap[FL_INDEX_COUNT];
unsigned int *sl_bitmap;

/* Head of free lists. */
block_header_t* blocks[FL_INDEX_COUNT][SL_INDEX_COUNT];
block_header_t** blocks;
} control_t;

#include "heap_tlsf_block_functions.h"
Expand All @@ -94,7 +103,7 @@ typedef void* tlsf_t;
typedef void* pool_t;

/* Create/destroy a memory pool. */
tlsf_t tlsf_create(void* mem);
tlsf_t tlsf_create(void* mem, size_t bytes);
tlsf_t tlsf_create_with_pool(void* mem, size_t bytes);
pool_t tlsf_get_pool(tlsf_t tlsf);

Expand All @@ -113,10 +122,10 @@ void tlsf_free(tlsf_t tlsf, void* ptr);
size_t tlsf_block_size(void* ptr);

/* Overheads/limits of internal structures. */
size_t tlsf_size(void);
size_t tlsf_size(tlsf_t tlsf);
size_t tlsf_align_size(void);
size_t tlsf_block_size_min(void);
size_t tlsf_block_size_max(void);
size_t tlsf_block_size_max(tlsf_t tlsf);
size_t tlsf_pool_overhead(void);
size_t tlsf_alloc_overhead(void);

Expand Down

0 comments on commit 1f1b286

Please sign in to comment.