aboutsummaryrefslogtreecommitdiffstats
path: root/src/generic/misc.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-05-06 22:29:08 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-05-11 13:56:21 -0400
commitf331936969552c9864e8ef58ec329e7060a5af60 (patch)
treef46b4f64ee7672343b7eece9a9c1aa18f76b84b4 /src/generic/misc.h
parent8f1d0c2a7c49b596cb5a9a8b92b3200485049cf6 (diff)
downloadkutter-f331936969552c9864e8ef58ec329e7060a5af60.tar.gz
kutter-f331936969552c9864e8ef58ec329e7060a5af60.tar.xz
kutter-f331936969552c9864e8ef58ec329e7060a5af60.zip
basecmd: Avoid calling malloc() from main code
Introduce a new board function alloc_chunk() to allocate dynamic memory. This allows the board code to implement memory allocations without using the standard malloc() interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/generic/misc.h')
-rw-r--r--src/generic/misc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/generic/misc.h b/src/generic/misc.h
index e8a13c00..4408a34a 100644
--- a/src/generic/misc.h
+++ b/src/generic/misc.h
@@ -14,7 +14,8 @@ uint8_t timer_is_before(uint32_t time1, uint32_t time2);
uint32_t timer_read_time(void);
void timer_periodic(void);
-size_t alloc_maxsize(size_t reqsize);
+void *alloc_chunk(size_t size);
+void *alloc_chunks(size_t size, size_t count, size_t *avail);
uint16_t crc16_ccitt(char *buf, uint8_t len);