Lines Matching refs:p_swap

42     mu->p_swap = NULL;  in pm_memusage_zero()
46 void pm_memusage_pswap_init_handle(pm_memusage_t *mu, pm_proportional_swap_t *p_swap) { in pm_memusage_pswap_init_handle() argument
47 mu->p_swap = p_swap; in pm_memusage_pswap_init_handle()
61 pm_proportional_swap_t *p_swap = NULL; in pm_memusage_pswap_create() local
63 p_swap = malloc(sizeof(pm_proportional_swap_t)); in pm_memusage_pswap_create()
64 if (p_swap == NULL) { in pm_memusage_pswap_create()
67 p_swap->array_size = swap_size / getpagesize(); in pm_memusage_pswap_create()
68 p_swap->offset_array = calloc(p_swap->array_size, sizeof(pm_pswap_refcount_t)); in pm_memusage_pswap_create()
69 if (p_swap->offset_array == NULL) { in pm_memusage_pswap_create()
71 free(p_swap); in pm_memusage_pswap_create()
72 p_swap = NULL; in pm_memusage_pswap_create()
76 return p_swap; in pm_memusage_pswap_create()
79 void pm_memusage_pswap_destroy(pm_proportional_swap_t *p_swap) { in pm_memusage_pswap_destroy() argument
80 if (p_swap) { in pm_memusage_pswap_destroy()
81 free(p_swap->offset_array); in pm_memusage_pswap_destroy()
82 free(p_swap); in pm_memusage_pswap_destroy()
89 if (mu->p_swap == NULL) in pm_memusage_pswap_add_offset()
92 if (offset > mu->p_swap->array_size) { in pm_memusage_pswap_add_offset()
96 if (mu->p_swap->offset_array[offset] == USHRT_MAX) { in pm_memusage_pswap_add_offset()
99 mu->p_swap->offset_array[offset]++; in pm_memusage_pswap_add_offset()
120 su->proportional += pagesize / mu->p_swap->offset_array[elem->offset]; in pm_memusage_pswap_get_usage()
121 su->unique += mu->p_swap->offset_array[elem->offset] == 1 ? pagesize : 0; in pm_memusage_pswap_get_usage()