mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
libqos: Convert malloc-pc allocator to a generic allocator
The allocator in malloc-pc has been extracted, so it can be used in every arch. This operation showed that both the alloc and free functions can be also generic. Because of this, the QGuestAllocator has been removed from is function to wrap the alloc and free function, and now just contains the allocator parameters. As a result, only the allocator initalizer and unitializer are arch dependent. Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
04636dc410
commit
292be092ad
5 changed files with 309 additions and 299 deletions
|
@ -15,15 +15,8 @@
|
|||
|
||||
#include "libqos/malloc.h"
|
||||
|
||||
typedef enum {
|
||||
PC_ALLOC_NO_FLAGS = 0x00,
|
||||
PC_ALLOC_LEAK_WARN = 0x01,
|
||||
PC_ALLOC_LEAK_ASSERT = 0x02,
|
||||
PC_ALLOC_PARANOID = 0x04
|
||||
} PCAllocOpts;
|
||||
|
||||
QGuestAllocator *pc_alloc_init(void);
|
||||
QGuestAllocator *pc_alloc_init_flags(PCAllocOpts flags);
|
||||
void pc_alloc_uninit(QGuestAllocator *allocator);
|
||||
QGuestAllocator *pc_alloc_init_flags(QAllocOpts flags);
|
||||
void pc_alloc_uninit(QGuestAllocator *allocator);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue