From cb69478268e4e7c72583b9f11755c900b1a8567b Mon Sep 17 00:00:00 2001 From: Arne Goedeke <el@laramies.com> Date: Mon, 24 Feb 2014 14:14:38 +0100 Subject: [PATCH] allocator: add some function attributes --- src/stack_allocator.c | 1 + src/stack_allocator.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/stack_allocator.c b/src/stack_allocator.c index f89a9b355b..aec9b91c12 100644 --- a/src/stack_allocator.c +++ b/src/stack_allocator.c @@ -1,5 +1,6 @@ #include "stack_allocator.h" +MALLOC_FUNCTION static struct chunk * alloc_chunk(size_t size) { struct chunk * c = (struct chunk*)xalloc(sizeof(struct chunk) + size); c->data = c->top = c + 1; diff --git a/src/stack_allocator.h b/src/stack_allocator.h index 66f5d63cdc..a60f11e8d1 100644 --- a/src/stack_allocator.h +++ b/src/stack_allocator.h @@ -1,4 +1,5 @@ #include "global.h" +#include "pike_memory.h" struct stack_allocator { struct chunk * cur; @@ -31,6 +32,7 @@ static INLINE void sa_alloc_enlarge(struct stack_allocator * a, size_t size) { stack_alloc_enlarge(a, size); } +MALLOC_FUNCTION static INLINE void * sa_alloc_fast(struct stack_allocator * a, size_t size) { struct chunk * c = a->cur; void * ret = c->top; @@ -38,6 +40,7 @@ static INLINE void * sa_alloc_fast(struct stack_allocator * a, size_t size) { return ret; } +MALLOC_FUNCTION static INLINE void * sa_alloc(struct stack_allocator * a, size_t size) { sa_alloc_enlarge(a, size); return sa_alloc_fast(a, size); -- GitLab