Changeset 999


Ignore:
Timestamp:
2012-07-19T06:05:56+02:00 (21 months ago)
Author:
moo
Message:

fix mem test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache/xc_mem.c

    r998 r999  
    339339    void *p; 
    340340    void *memory; 
     341    xc_mem_t *mem; 
    341342    void **ptrs; 
    342     xc_mem_t mem_holder, *mem = &mem_holder; 
    343343    int size, i; 
    344344 
     
    347347    scanf("%d", &size); 
    348348#else 
    349     size = 100; 
     349    size = 1024; 
    350350#endif 
    351351    CHECK(memory = malloc(size), "OOM"); 
    352352    CHECK(ptrs   = malloc(size * sizeof(void *)), "OOM"); 
    353     CHECK(mem    = xc_mem_init(memory, mem, size), "Failed init memory allocator"); 
     353    mem = (xc_mem_t *) memory; 
     354    CHECK(mem    = xc_mem_init(NULL, mem, size), "Failed init memory allocator"); 
    354355 
    355356    while ((p = xc_mem_malloc(mem, 1))) { 
    356         fprintf(stderr, "%d %p\n", count, ptrs); 
    357357        ptrs[count ++] = p; 
    358358    } 
Note: See TracChangeset for help on using the changeset viewer.