From: BitKeeper B. <ri...@su...> - 2005-02-02 17:02:35
|
ChangeSet 1.1752.2.3, 2005/02/02 12:54:40+00:00, ia...@la... Introduce _xmalloc for when you really want just bytes. Signed-off-by: ian...@cl... arch/x86/microcode.c | 2 +- arch/x86/pci-pc.c | 2 +- arch/x86/shadow.c | 2 +- common/sched_bvt.c | 2 +- common/slab.c | 6 +++--- include/asm-x86/shadow.h | 2 +- include/xen/slab.h | 10 +++++----- 7 files changed, 13 insertions(+), 13 deletions(-) diff -Nru a/xen/arch/x86/microcode.c b/xen/arch/x86/microcode.c --- a/xen/arch/x86/microcode.c 2005-02-02 12:02:33 -05:00 +++ b/xen/arch/x86/microcode.c 2005-02-02 12:02:33 -05:00 @@ -84,7 +84,7 @@ #define DECLARE_MUTEX(_m) spinlock_t _m = SPIN_LOCK_UNLOCKED #define down(_m) spin_lock(_m) #define up(_m) spin_unlock(_m) -#define vmalloc(_s) xmalloc(_s) +#define vmalloc(_s) _xmalloc(_s) #define vfree(_p) xfree(_p) #define num_online_cpus() smp_num_cpus static inline int on_each_cpu( diff -Nru a/xen/arch/x86/pci-pc.c b/xen/arch/x86/pci-pc.c --- a/xen/arch/x86/pci-pc.c 2005-02-02 12:02:33 -05:00 +++ b/xen/arch/x86/pci-pc.c 2005-02-02 12:02:33 -05:00 @@ -1036,7 +1036,7 @@ if (ret & 0xff00) printk(KERN_ERR "PCI: Error %02x when fetching IRQ routing table.\n", (ret >> 8) & 0xff); else if (opt.size) { - rt = xmalloc(sizeof(struct irq_routing_table) + opt.size); + rt = _xmalloc(sizeof(struct irq_routing_table) + opt.size); if (rt) { memset(rt, 0, sizeof(struct irq_routing_table)); rt->size = opt.size + sizeof(struct irq_routing_table); diff -Nru a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c --- a/xen/arch/x86/shadow.c 2005-02-02 12:02:33 -05:00 +++ b/xen/arch/x86/shadow.c 2005-02-02 12:02:33 -05:00 @@ -185,7 +185,7 @@ { m->shadow_dirty_bitmap_size = (p->max_pages + 63) & ~63; m->shadow_dirty_bitmap = - xmalloc(m->shadow_dirty_bitmap_size/8); + _xmalloc(m->shadow_dirty_bitmap_size/8); if ( m->shadow_dirty_bitmap == NULL ) { m->shadow_dirty_bitmap_size = 0; diff -Nru a/xen/common/sched_bvt.c b/xen/common/sched_bvt.c --- a/xen/common/sched_bvt.c 2005-02-02 12:02:33 -05:00 +++ b/xen/common/sched_bvt.c 2005-02-02 12:02:33 -05:00 @@ -171,7 +171,7 @@ { struct domain *d = ed->domain; if ( (d->sched_priv == NULL) ) { - if ( (d->sched_priv = new(struct bvt_dom_info)) == NULL ) + if ( (d->sched_priv = xmalloc(struct bvt_dom_info)) == NULL ) return -1; memset(d->sched_priv, 0, sizeof(struct bvt_dom_info)); } diff -Nru a/xen/common/slab.c b/xen/common/slab.c --- a/xen/common/slab.c 2005-02-02 12:02:33 -05:00 +++ b/xen/common/slab.c 2005-02-02 12:02:33 -05:00 @@ -1449,10 +1449,10 @@ } /** - * xmalloc - allocate memory + * _xmalloc - allocate memory * @size: how many bytes of memory are required. */ -void *xmalloc(size_t size) +void *_xmalloc(size_t size) { cache_sizes_t *csizep = cache_sizes; @@ -1548,7 +1548,7 @@ for (i = 0; i< smp_num_cpus; i++) { cpucache_t* ccnew; - ccnew = xmalloc(sizeof(void*)*limit+sizeof(cpucache_t)); + ccnew = _xmalloc(sizeof(void*)*limit+sizeof(cpucache_t)); if (!ccnew) goto oom; ccnew->limit = limit; diff -Nru a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h --- a/xen/include/asm-x86/shadow.h 2005-02-02 12:02:33 -05:00 +++ b/xen/include/asm-x86/shadow.h 2005-02-02 12:02:33 -05:00 @@ -616,7 +616,7 @@ { SH_LOG("Allocate more shadow hashtable blocks."); - extra = xmalloc( + extra = _xmalloc( sizeof(void *) + (shadow_ht_extra_size * sizeof(*x))); /* XXX Should be more graceful here. */ diff -Nru a/xen/include/xen/slab.h b/xen/include/xen/slab.h --- a/xen/include/xen/slab.h 2005-02-02 12:02:33 -05:00 +++ b/xen/include/xen/slab.h 2005-02-02 12:02:33 -05:00 @@ -46,7 +46,7 @@ extern void *xmem_cache_alloc(xmem_cache_t *); extern void xmem_cache_free(xmem_cache_t *, void *); -extern void *xmalloc(size_t); +extern void *_xmalloc(size_t); extern void xfree(const void *); extern int xmem_cache_reap(void); @@ -54,15 +54,15 @@ extern void dump_slabinfo(); /* Nicely typesafe for you. */ -#define xmalloc(type) ((type *)xmalloc(sizeof(type))) -#define xmalloc_array(type, num) ((type *)xmalloc_array(sizeof(type), (num))) +#define xmalloc(type) ((type *)_xmalloc(sizeof(type))) +#define xmalloc_array(type, num) ((type *)_xmalloc_array(sizeof(type), (num))) -static inline void *xmalloc_array(size_t size, size_t num) +static inline void *_xmalloc_array(size_t size, size_t num) { /* Check for overflow. */ if (size && num > UINT_MAX / size) return NULL; - return xmalloc(size * num); + return _xmalloc(size * num); } #endif /* __ARCH_HAS_SLAB_ALLOCATOR */ |