Stefan Hajnoczi writes:
> On Thu, Jul 31, 2014 at 05:14:12PM -0400, John Snow wrote:
>>
>> On 07/31/2014 06:13 AM, Stefan Hajnoczi wrote:
>> >On Wed, Jul 30, 2014 at 06:28:28PM -0400, John Snow wrote:
>> >>-static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size)
>> >>+static inline voi
On Thu, Jul 31, 2014 at 05:14:12PM -0400, John Snow wrote:
>
> On 07/31/2014 06:13 AM, Stefan Hajnoczi wrote:
> >On Wed, Jul 30, 2014 at 06:28:28PM -0400, John Snow wrote:
> >>-static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size)
> >>+static inline void mlist_insert(MemList *head, Mem
On 07/31/2014 06:13 AM, Stefan Hajnoczi wrote:
On Wed, Jul 30, 2014 at 06:28:28PM -0400, John Snow wrote:
+#define bitany(X, MASK) ((X) & (MASK))
+#define bitset(X, MASK) (bitany((X), (MASK)) == (MASK))
This is subjective but macros like this should be avoided. This macro does not
encapsulate
On Wed, Jul 30, 2014 at 06:28:28PM -0400, John Snow wrote:
> +#define bitany(X, MASK) ((X) & (MASK))
> +#define bitset(X, MASK) (bitany((X), (MASK)) == (MASK))
This is subjective but macros like this should be avoided. This macro does not
encapsulate anything substantial. It forces the reader to
Implement a simple first-fit memory allocator that
attempts to keep track of leased blocks of memory
in order to be able to re-use blocks.
Additionally, allow the user to specify when
initializing the device that upon cleanup,
we would like to assert that there are no
blocks in use. This may be us
On Tue, Jul 29, 2014 at 05:54:43PM -0400, John Snow wrote:
> diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
> index 2efd095..410181d 100644
> --- a/tests/libqos/malloc-pc.c
> +++ b/tests/libqos/malloc-pc.c
> @@ -21,41 +21,336 @@
>
> #define PAGE_SIZE (4096)
>
> +typedef struc
Implement a simple first-fit memory allocator that
attempts to keep track of leased blocks of memory
in order to be able to re-use blocks.
Additionally, allow the user to specify when
initializing the device that upon cleanup,
we would like to assert that there are no
blocks in use. This may be us