Skip to content

Commit

Permalink
kernel allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieMonroe committed Aug 12, 2013
1 parent 94ab2dd commit 18ecd04
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ SRCS = libunwind.c \
Lset_fpreg.c \
Lset_reg.c \
mempool.c \
strerror.c
strerror.c \
malloc_types.c

.include <bsd.kmod.mk>
4 changes: 2 additions & 2 deletions flush_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ unw_flush_cache (unw_addr_space_t as, unw_word_t lo, unw_word_t hi)
for (; w; w = w->next)
{
if (w->index)
free (w->index);
free (w->debug_frame);
free (w->index, M_LIBUNWIND_TYPE);
free (w->debug_frame, M_LIBUNWIND_TYPE);
}
as->debug_frames = NULL;

Expand Down
1 change: 1 addition & 0 deletions include/libunwind_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ do { \
#define mutex_unlock(l) \
sx_unlock(l)

MALLOC_DECLARE(M_LIBUNWIND_TYPE);

static inline int
cmpxchg_ptr (void *addr, void *old, void *new)
Expand Down
4 changes: 4 additions & 0 deletions malloc_types.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <sys/malloc.h>

MALLOC_DEFINE(M_LIBUNWIND_TYPE, "libunwind allocations", "Libunwind "
"Allocations");

0 comments on commit 18ecd04

Please sign in to comment.