Skip to content

Commit 215e18e

Browse files
excluded unused section in collections.h, reduced size of g_fb_alloc_stack and fb_alloc shanged with xalloc in stm32ipl_integral.c
1 parent 5ba273e commit 215e18e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Inc/collections.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <stdbool.h>
1414
#include <stddef.h>
1515

16+
#ifndef STM32IPL
1617
////////////
1718
// bitmap //
1819
////////////
@@ -31,6 +32,7 @@ void bitmap_bit_set(bitmap_t *ptr, size_t index);
3132
bool bitmap_bit_get(bitmap_t *ptr, size_t index);
3233
#define BITMAP_COMPUTE_ROW_INDEX(image, y) (((image)->w)*(y))
3334
#define BITMAP_COMPUTE_INDEX(row_index, x) ((row_index)+(x))
35+
#endif // STM32IPL
3436

3537
//////////
3638
// lifo //

Src/stm32ipl_integral.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ stm32ipl_err_t STM32Ipl_IIAllocData(i_image_t *iimg, uint32_t width, uint32_t he
3939

4040
STM32IPL_CHECK_VALID_IMAGE(iimg)
4141

42-
data = fb_alloc(width * height * sizeof(uint32_t), FB_ALLOC_NO_HINT);
42+
data = xalloc(width * height * sizeof(uint32_t));
4343
if (!data) {
4444
iimg->w = 0;
4545
iimg->h = 0;
@@ -61,7 +61,8 @@ stm32ipl_err_t STM32Ipl_IIAllocData(i_image_t *iimg, uint32_t width, uint32_t he
6161
*/
6262
void STM32Ipl_IIReleaseData(i_image_t *iimg)
6363
{
64-
fb_free();
64+
if (iimg)
65+
xfree(iimg->data);
6566
}
6667

6768
/**

Src/stm32ipl_mem_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern "C" {
2929
#endif
3030

3131
///@cond
32-
#define FB_ALLOC_MAX_ENTRY 1000 /* Max number of entries managed with fb_alloc. */
32+
#define FB_ALLOC_MAX_ENTRY 64 /* Max number of entries managed with fb_alloc. */
3333

3434
static uint32_t g_fb_alloc_stack[FB_ALLOC_MAX_ENTRY];
3535
static uint32_t g_fb_alloc_inext = 0;

0 commit comments

Comments
 (0)