2 * Basic libqos generic malloc support
4 * Copyright (c) 2014 Marc MarĂ
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
10 #include "qemu/osdep.h"
12 #include "libqos/malloc-generic.h"
13 #include "libqos/malloc.h"
16 * Mostly for valgrind happiness, but it does offer
17 * a chokepoint for debugging guest memory leaks, too.
19 void generic_alloc_uninit(QGuestAllocator
*allocator
)
21 alloc_uninit(allocator
);
24 QGuestAllocator
*generic_alloc_init_flags(uint64_t base_addr
, uint64_t size
,
25 uint32_t page_size
, QAllocOpts flags
)
28 uint64_t start
= base_addr
+ (1 << 20); /* Start at 1MB */
30 s
= alloc_init_flags(flags
, start
, start
+ size
);
31 alloc_set_page_size(s
, page_size
);
36 inline QGuestAllocator
*generic_alloc_init(uint64_t base_addr
, uint64_t size
,
39 return generic_alloc_init_flags(base_addr
, size
, page_size
, ALLOC_NO_FLAGS
);