aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index eb62507..9c78e4c 100644
--- a/src/util.h
+++ b/src/util.h
@@ -385,6 +385,12 @@ static inline void *malloc_fseg(u32 size) {
static inline void *malloc_tmphigh(u32 size) {
return pmm_malloc(&ZoneTmpHigh, PMM_DEFAULT_HANDLE, size, MALLOC_MIN_ALIGN);
}
+static inline void *malloc_tmp(u32 size) {
+ void *ret = malloc_tmphigh(size);
+ if (ret)
+ return ret;
+ return pmm_malloc(&ZoneTmpLow, PMM_DEFAULT_HANDLE, size, MALLOC_MIN_ALIGN);
+}
static inline void *memalign_low(u32 align, u32 size) {
return pmm_malloc(&ZoneLow, PMM_DEFAULT_HANDLE, size, align);
}