Re: [PATCH] gnumach: kalloc: Zone determining and constants optimization

2011-03-30 Thread Samuel Thibault
Maksym Planeta, le Wed 30 Mar 2011 08:49:01 +0300, a écrit : > +#define KALLOC_MAP_SIZE 8 * 1024 * 1024 > +#define ZONE_START_ORDER 4 > +#define ZONES_COUNT 12 > +#define ZONE_MAX_ORDER (ZONES_COUNT + ZONE_START_ORDER - 1) > +#define SIZE_BY_ORDER(x) (1UL << (ZONE_START_ORDER + x)) > +#define ZONE_

[PATCH] gnumach: kalloc: Zone determining and constants optimization

2011-03-29 Thread Maksym Planeta
Variables, which change their value only once, by the initialization were defined as macros. Routine for determining zone for object depends of object size. Since zone sizes are powers of two this routine was optimized. On x86 proceessors will be used bsr instruction. Signed-off-by: Maksym Planet