Nginx内存池源码刨析

Nginx 内存池刨析

实例源码刨析

#define BLOCK_SIZE  16   //每次分配内存块大小

#define MEM_POOL_SIZE (1024 * 4) //内存池每块大小


	int i = 0, k = 0;
	int use_free = 0;

	ngx_pagesize = getpagesize();//获取系统的页大小
	//printf("pagesize: %zu\n",ngx_pagesize);

 
	 
	    char * ptr = NULL;
	
	    for(k = 0; k< 1024 * 500; k++)
	    {
	        ngx_pool_t * mem_pool = ngx_create_pool(MEM_POOL_SIZE);//创建池
		    
		for(i = 0; i < 1024 ; i++)
		{
		    ptr = ngx_palloc(mem_pool,BLOCK_SIZE);

		    if(!ptr) fprintf(stderr,"ngx_palloc failed. \n");
		    else {
		        *ptr = '\0';
				*(ptr + BLOCK_SIZE -1) = '\0';
            }
		}
		    
            ngx_destroy_pool(mem_pool);
	    }
	 

一些函数和宏定义

#define NGX_ALIGNMENT   sizeof(unsigned long)    /* platform word 平台字节长*/
#define ngx_align(d, a)     (((d) + (a - 1)) & ~(a - 1)) /* b对齐为a的倍数*/
#define ngx_align_ptr(p, a)                                                   \
    (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))/*用于将指针 p 对齐到指定的对齐字节数 a*/
#define ngx_memzero(buf, n)       (void) memset(buf, 0, n)

ngx_create_pool

创建线程池


ngx_pool_t * ngx_create_pool(size_t size)
{
    ngx_pool_t  *p;

    p = ngx_memalign(NGX_POOL_ALIGNMENT, size);
    if (p == NULL) {
        return NULL;
    }
    //它将 p 指针向后偏移 sizeof(ngx_pool_t) 字节,这样 p->d.last 就指向了内存块中除去 ngx_pool_t 结构体大小后的位置,即可用于分配的起始位置。
    //将 p 指向的内存块的 last 成员设置为指向当前内存块后面的一段内存的起始地址。
    //这段内存的大小为 sizeof(ngx_pool_t),即 ngx_pool_t 结构体的大小。
    //这样做是为了在这块内存中分配其他数据时,可以从这段内存的末尾开始分配,确保内存块的内存布局是连续的。
    p->d.last = (u_char *) p + sizeof(ngx_pool_t);//指向这块内存已使用区域的最后部分。
    
    //指向未使用区域的尾部
    p->d.end = (u_char *) p + size;
    //下一块内存块的地址
    p->d.next = NULL;

    //内存分配的失败次数
    p->d.failed = 0;

    //这行代码确定了内存池中可用于分配的最大内存大小。为了确保内存分配不会超出预先设定的阈值, 
    size = size - sizeof(ngx_pool_t);
    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;

    // 当前正在使用的数据块的指针
    p->current = p;
    //p->chain = NULL;
    p->large = NULL;
    //p->cleanup = NULL;
    //p->log = log;

    return p;
}

ngx_memalign

void * ngx_memalign(size_t alignment, size_t size)
{
    void  *p;
    int    err;

    err = posix_memalign(&p, alignment, size);//按照指定的对齐要求和大小分配内存块。

    if (err) {
        fprintf(stderr,"posix_memalign(%zu, %zu) failed", alignment, size);
        p = NULL;
    }

    if(debug) fprintf(stderr,"posix_memalign: %p:%zu @%zu", p, size, alignment);

    return p;
}

ngx_palloc分配内存

void *ngx_palloc(ngx_pool_t *pool, size_t size)
{
    //判断是分配内存池的内存还是单独分配一块内存位于大储存块区。
#if !(NGX_DEBUG_PALLOC)
    if (size <= pool->max) {
        return ngx_palloc_small(pool, size, 1);
    }
#endif

    return ngx_palloc_large(pool, size);
}

static inline void *ngx_palloc_small(ngx_pool_t *pool, size_t size, ngx_uint_t align)
{
    u_char      *m;
    ngx_pool_t  *p;

    p = pool->current;

    do {
        m = p->d.last;

        if (align) {
            m = ngx_align_ptr(m, NGX_ALIGNMENT);
        }

        if ((size_t) (p->d.end - m) >= size) {
            p->d.last = m + size;

            return m;
        }

        p = p->d.next;

    } while (p);

    return ngx_palloc_block(pool, size);
}

  1. 定义一个指向内存池结构的指针p。
  2. 将当前内存池的指针赋值给p。
  3. 使用一个do-while循环来遍历内存池链表。
  4. 获取当前内存池的最后一个内存块的指针m。
  5. 如果align为真,则将m对齐到NGX_ALIGNMENT字节边界。
  6. 检查当前内存池中是否有足够的空间来分配size大小的内存块。如果有足够的空间,将内存块的指针m设置为分配内存块的起始地址,并将内存池的最后一个内存块的指针更新为m+size。然后返回m。
  7. 如果内存池中没有足够的空间,则将p指向下一个内存池,继续遍历内存池链表。
  8. 如果遍历完内存池链表仍然没有找到足够的空间,则调用ngx_palloc_block函数分配一个新的内存块,并将新分配的内存块的指针返回。

ngx_palloc_large


static void *ngx_palloc_large(ngx_pool_t *pool, size_t size)
{
    void              *p;
    ngx_uint_t         n;
    ngx_pool_large_t  *large;

    p = ngx_alloc(size);
    if (p == NULL) {
        return NULL;
    }

    n = 0;

    for (large = pool->large; large; large = large->next) {
        if (large->alloc == NULL) {
            large->alloc = p;
            return p;
        }

        if (n++ > 3) {
            break;
        }
    }

    large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
    if (large == NULL) {
        ngx_free(p);
        return NULL;
    }

    large->alloc = p;
    large->next = pool->large;
    pool->large = large;

    return p;
}

  1. 首先,尝试使用ngx_alloc函数分配一块大小为size的内存。如果分配成功,则将该内存块的指针赋值给p
  2. 然后,遍历内存池中的large链表,查找一个alloc字段为NULL的节点。如果找到,则将分配的内存块的指针赋值给该节点的alloc字段,并返回该内存块的指针。
  3. 如果遍历了large链表3次仍然没有找到合适的节点,则跳出循环。
  4. 分配一个新的ngx_pool_large_t结构体,将其alloc字段赋值为分配的内存块的指针,并将该结构体添加到内存池的large链表中。
  5. 返回分配的内存块的指针。

函数ngx_palloc_large的用途是在Nginx的内存池中分配大块内存。在Nginx中,大块内存通常用于存储文件句柄、连接池等。

注意事项:

  1. 在使用ngx_palloc_large分配内存后,需要确保在适当的时候释放内存,以避免内存泄漏。
  2. 在使用ngx_palloc_large分配内存时,如果内存池中的large链表已经很长,可能会导致内存分配效率降低。因此,在分配大块内存时,可以考虑使用其他内存分配机制,如ngx_palloc函数。

void * ngx_alloc(size_t size)
{
    void  *p;

    p = malloc(size);
    if (p == NULL) {
        fprintf(stderr,"malloc(%zu) failed", size);
    }

    if(debug) fprintf(stderr, "malloc: %p:%zu", p, size);

    return p;
}

void *ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment)
{
    void              *p;
    ngx_pool_large_t  *large;

    p = ngx_memalign(alignment, size);
    if (p == NULL) {
        return NULL;
    }

    large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
    if (large == NULL) {
        ngx_free(p);
        return NULL;
    }

    large->alloc = p;
    large->next = pool->large;
    pool->large = large;

    return p;
}

  1. 使用ngx_memalign函数尝试分配一块大小为size且对齐为alignment的内存。如果分配失败,直接返回NULL
  2. 使用ngx_palloc_small函数在内存池中分配一个ngx_pool_large_t结构体的空间,用于存储分配的内存块信息。如果分配失败,释放之前分配的内存,并返回NULL
  3. 将分配的内存块的指针存入ngx_pool_large_t结构体的alloc字段,并将该结构体添加到内存池的large链表中。
  4. 返回分配的内存块的指针。


void * ngx_pcalloc(ngx_pool_t *pool, size_t size)
{
    void *p;

    p = ngx_palloc(pool, size);
    if (p) {
        ngx_memzero(p, size);
    }

    return p;
}



  1. 首先,通过ngx_palloc函数尝试在内存池中分配一块大小为size的内存。如果分配成功,则将返回的指针赋值给p
  2. 如果p不为空,使用ngx_memzero函数将p指向的内存块初始化为全零。ngx_memzero函数的作用是将一块内存块的所有字节设置为零,这在初始化内存时非常有用,可以确保内存中的所有字节都被初始化为零,从而避免未初始化的内存导致的错误。
  3. 最后,返回p,即分配的内存块的指针。

源码部分

#include "mem_core.h"


#define BLOCK_SIZE  16   //每次分配内存块大小

#define MEM_POOL_SIZE (1024 * 4) //内存池每块大小



int main(int argc, char **argv)
{
	int i = 0, k = 0;
	int use_free = 0;

	ngx_pagesize = getpagesize();
	//printf("pagesize: %zu\n",ngx_pagesize);

	
	if(argc >= 2){
		use_free = 1;
		printf("use malloc/free\n");		
	} else {
             printf("use mempool.\n");
        }

	if(!use_free){
	    char * ptr = NULL;
	
	    for(k = 0; k< 1024 * 500; k++)
	    {
	        ngx_pool_t * mem_pool = ngx_create_pool(MEM_POOL_SIZE);
		    
		for(i = 0; i < 1024 ; i++)
		{
		    ptr = ngx_palloc(mem_pool,BLOCK_SIZE);

		    if(!ptr) fprintf(stderr,"ngx_palloc failed. \n");
		    else {
		         *ptr = '\0';
			 *(ptr + BLOCK_SIZE -1) = '\0';
                    }
		}
		    
                ngx_destroy_pool(mem_pool);
	    }
	} else {
	    char * ptr[1024];
	    for(k = 0; k< 1024 * 500; k++){
		for(i = 0; i < 1024 ; i++)
                {
                    ptr[i] = malloc(BLOCK_SIZE);
		    if(!ptr[i]) fprintf(stderr,"malloc failed. reason:%s\n",strerror(errno));
		    else{
		         *ptr[i] = '\0';
			 *(ptr[i] +  BLOCK_SIZE - 1) = '\0';
		    }
                }

		for(i = 0; i < 1024 ; i++){
		    if(ptr[i]) free(ptr[i]);
		}
	    }

	}
	return 0;
}


/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#include "mem_core.h"

static int debug = 0;

ngx_uint_t  ngx_pagesize;
ngx_uint_t  ngx_pagesize_shift;
ngx_uint_t  ngx_cacheline_size;



void *
ngx_alloc(size_t size)
{
    void  *p;

    p = malloc(size);
    if (p == NULL) {
        fprintf(stderr,"malloc(%zu) failed", size);
    }

    if(debug) fprintf(stderr, "malloc: %p:%zu", p, size);

    return p;
}


void *
ngx_calloc(size_t size)
{
    void  *p;

    p = ngx_alloc(size);

    if (p) {
        ngx_memzero(p, size);
    }

    return p;
}

/*
#if (NGX_HAVE_POSIX_MEMALIGN)

void *
ngx_memalign(size_t alignment, size_t size)
{
    void  *p;
    int    err;

    err = posix_memalign(&p, alignment, size);

    if (err) {
        fprintf(stderr,"posix_memalign(%zu, %zu) failed", alignment, size);
        p = NULL;
    }

    if(debug) fprintf(stderr,"posix_memalign: %p:%zu @%zu", p, size, alignment);

    return p;
}

#elif (NGX_HAVE_MEMALIGN)

void *
ngx_memalign(size_t alignment, size_t size)
{
    void  *p;

    p = memalign(alignment, size);
    if (p == NULL) {
        fprintf(stderr,"memalign(%zu, %zu) failed", alignment, size);
    }

    if(debug) fprintf(stderr,"memalign: %p:%zu @%zu", p, size, alignment);

    return p;
}

#endif
*/



/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#ifndef _NGX_ALLOC_H_INCLUDED_
#define _NGX_ALLOC_H_INCLUDED_



#include "mem_core.h"


void *ngx_alloc(size_t size);
void *ngx_calloc(size_t size);

#define ngx_free         free


/*
 * Linux has memalign() or posix_memalign()
 * Solaris has memalign()
 * FreeBSD 7.0 has posix_memalign(), besides, early version's malloc()
 * aligns allocations bigger than page size at the page boundary
 */

/*#if (NGX_HAVE_POSIX_MEMALIGN || NGX_HAVE_MEMALIGN)

void *ngx_memalign(size_t alignment, size_t size);

#else
*/
#define ngx_memalign(alignment, size)  ngx_alloc(size)
/*
#endif
*/

extern ngx_uint_t  ngx_pagesize;
extern ngx_uint_t  ngx_pagesize_shift;
extern ngx_uint_t  ngx_cacheline_size;


#endif /* _NGX_ALLOC_H_INCLUDED_ */



/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#ifndef _NGX_CORE_H_INCLUDED_
#define _NGX_CORE_H_INCLUDED_


#define NGX_HAVE_POSIX_MEMALIGN  1


typedef struct ngx_pool_s            ngx_pool_t;


#define  NGX_OK          0
#define  NGX_ERROR      -1
#define  NGX_AGAIN      -2
#define  NGX_BUSY       -3
#define  NGX_DONE       -4
#define  NGX_DECLINED   -5
#define  NGX_ABORT      -6



#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <error.h>
#include <sys/stat.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>

typedef intptr_t        ngx_int_t;
typedef uintptr_t       ngx_uint_t;

#define NGX_ALIGNMENT   sizeof(unsigned long)    /* platform word */
#define ngx_align(d, a)     (((d) + (a - 1)) & ~(a - 1))
#define ngx_align_ptr(p, a)                                                   \
    (u_char *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))

#define ngx_memzero(buf, n)       (void) memset(buf, 0, n)

#include "mem_alloc.h"
#include "mem_pool_palloc.h"


#endif /* _NGX_CORE_H_INCLUDED_ */



/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#include "mem_core.h"


static inline void *ngx_palloc_small(ngx_pool_t *pool, size_t size,
    ngx_uint_t align);
static void *ngx_palloc_block(ngx_pool_t *pool, size_t size);
static void *ngx_palloc_large(ngx_pool_t *pool, size_t size);


ngx_pool_t *
ngx_create_pool(size_t size)
{
    ngx_pool_t  *p;

    p = ngx_memalign(NGX_POOL_ALIGNMENT, size);
    if (p == NULL) {
        return NULL;
    }

    p->d.last = (u_char *) p + sizeof(ngx_pool_t);
    p->d.end = (u_char *) p + size;
    p->d.next = NULL;
    p->d.failed = 0;

    size = size - sizeof(ngx_pool_t);
    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;

    p->current = p;
    //p->chain = NULL;
    p->large = NULL;
    //p->cleanup = NULL;
    //p->log = log;

    return p;
}


void
ngx_destroy_pool(ngx_pool_t *pool)
{
    ngx_pool_t          *p, *n;
    ngx_pool_large_t    *l;
    //ngx_pool_cleanup_t  *c;

    /*for (c = pool->cleanup; c; c = c->next) {
        if (c->handler) {
            ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, pool->log, 0,
                           "run cleanup: %p", c);
            c->handler(c->data);
        }
    }*/

#if (NGX_DEBUG)

    /*
     * we could allocate the pool->log from this pool
     * so we cannot use this log while free()ing the pool
     */

    for (l = pool->large; l; l = l->next) {
        fprintf(stderr,"free: %p", l->alloc);
    }

    for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
        fprintf(stderr,"free: %p, unused: %zu", p, p->d.end - p->d.last);

        if (n == NULL) {
            break;
        }
    }

#endif

    for (l = pool->large; l; l = l->next) {
        if (l->alloc) {
            ngx_free(l->alloc);
        }
    }

    for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
        ngx_free(p);

        if (n == NULL) {
            break;
        }
    }
}


void
ngx_reset_pool(ngx_pool_t *pool)
{
    ngx_pool_t        *p;
    ngx_pool_large_t  *l;

    for (l = pool->large; l; l = l->next) {
        if (l->alloc) {
            ngx_free(l->alloc);
        }
    }

    for (p = pool; p; p = p->d.next) {
        p->d.last = (u_char *) p + sizeof(ngx_pool_t);
        p->d.failed = 0;
    }

    pool->current = pool;
    //pool->chain = NULL;
    pool->large = NULL;
}


void *ngx_palloc(ngx_pool_t *pool, size_t size)
{
#if !(NGX_DEBUG_PALLOC)
    if (size <= pool->max) {
        return ngx_palloc_small(pool, size, 1);
    }
#endif

    return ngx_palloc_large(pool, size);
}


void *
ngx_pnalloc(ngx_pool_t *pool, size_t size)
{
#if !(NGX_DEBUG_PALLOC)
    if (size <= pool->max) {
        return ngx_palloc_small(pool, size, 0);
    }
#endif

    return ngx_palloc_large(pool, size);
}


static inline void *
ngx_palloc_small(ngx_pool_t *pool, size_t size, ngx_uint_t align)
{
    u_char      *m;
    ngx_pool_t  *p;

    p = pool->current;

    do {
        m = p->d.last;

        if (align) {
            m = ngx_align_ptr(m, NGX_ALIGNMENT);
        }

        if ((size_t) (p->d.end - m) >= size) {
            p->d.last = m + size;

            return m;
        }

        p = p->d.next;

    } while (p);

    return ngx_palloc_block(pool, size);
}


static void *
ngx_palloc_block(ngx_pool_t *pool, size_t size)
{
    u_char      *m;
    size_t       psize;
    ngx_pool_t  *p, *new;

    psize = (size_t) (pool->d.end - (u_char *) pool);

    m = ngx_memalign(NGX_POOL_ALIGNMENT, psize);
    if (m == NULL) {
        return NULL;
    }

    new = (ngx_pool_t *) m;

    new->d.end = m + psize;
    new->d.next = NULL;
    new->d.failed = 0;

    m += sizeof(ngx_pool_data_t);
    m = ngx_align_ptr(m, NGX_ALIGNMENT);
    new->d.last = m + size;

    for (p = pool->current; p->d.next; p = p->d.next) {
        if (p->d.failed++ > 4) {
            pool->current = p->d.next;
        }
    }

    p->d.next = new;

    return m;
}


static void *
ngx_palloc_large(ngx_pool_t *pool, size_t size)
{
    void              *p;
    ngx_uint_t         n;
    ngx_pool_large_t  *large;

    p = ngx_alloc(size);
    if (p == NULL) {
        return NULL;
    }

    n = 0;

    for (large = pool->large; large; large = large->next) {
        if (large->alloc == NULL) {
            large->alloc = p;
            return p;
        }

        if (n++ > 3) {
            break;
        }
    }

    large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
    if (large == NULL) {
        ngx_free(p);
        return NULL;
    }

    large->alloc = p;
    large->next = pool->large;
    pool->large = large;

    return p;
}


void *
ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment)
{
    void              *p;
    ngx_pool_large_t  *large;

    p = ngx_memalign(alignment, size);
    if (p == NULL) {
        return NULL;
    }

    large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
    if (large == NULL) {
        ngx_free(p);
        return NULL;
    }

    large->alloc = p;
    large->next = pool->large;
    pool->large = large;

    return p;
}


ngx_int_t
ngx_pfree(ngx_pool_t *pool, void *p)
{
    ngx_pool_large_t  *l;

    for (l = pool->large; l; l = l->next) {
        if (p == l->alloc) {
            fprintf(stderr,"free: %p", l->alloc);
            ngx_free(l->alloc);
            l->alloc = NULL;

            return NGX_OK;
        }
    }

    return NGX_DECLINED;
}


void *
ngx_pcalloc(ngx_pool_t *pool, size_t size)
{
    void *p;

    p = ngx_palloc(pool, size);
    if (p) {
        ngx_memzero(p, size);
    }

    return p;
}





/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#ifndef _NGX_PALLOC_H_INCLUDED_
#define _NGX_PALLOC_H_INCLUDED_


#include "mem_core.h"


/*
 * NGX_MAX_ALLOC_FROM_POOL should be (ngx_pagesize - 1), i.e. 4095 on x86.
 * On Windows NT it decreases a number of locked pages in a kernel.
 */
#define NGX_MAX_ALLOC_FROM_POOL  (ngx_pagesize - 1)

#define NGX_DEFAULT_POOL_SIZE    (16 * 1024)

#define NGX_POOL_ALIGNMENT       16
#define NGX_MIN_POOL_SIZE                                                     \
    ngx_align((sizeof(ngx_pool_t) + 2 * sizeof(ngx_pool_large_t)),            \
              NGX_POOL_ALIGNMENT)




typedef struct ngx_pool_large_s  ngx_pool_large_t;



struct ngx_pool_large_s {
    ngx_pool_large_t     *next;     // 指向下一块大内存块的指针
    void                 *alloc;    // 大内存块的起始地址
};
 
typedef struct {
    u_char               *last;     // 保存当前数据块中内存分配指针的当前位置。每次Nginx程序从内存池中申请内存时,
                                    //从该指针保存的位置开始划分出请求的内存大小,并更新该指针到新的位置。
    u_char               *end;      // 保存内存块的结束位置
    ngx_pool_t           *next;     // 内存池由多块内存块组成,指向下一个数据块的位置。
    ngx_uint_t            failed;   // 当前数据块内存不足引起分配失败的次数
} ngx_pool_data_t;
 
struct ngx_pool_s {
    ngx_pool_data_t       d;        // 内存池当前的数据区指针的结构体
    size_t                max;      // 当前数据块最大可分配的内存大小(Bytes)
    ngx_pool_t           *current;  // 当前正在使用的数据块的指针
    ngx_pool_large_t     *large;    // pool 中指向大数据块的指针(大数据快是指 size > max 的数据块)

};



void *ngx_alloc(size_t size);
void *ngx_calloc(size_t size);

ngx_pool_t *ngx_create_pool(size_t size);
void ngx_destroy_pool(ngx_pool_t *pool);
void ngx_reset_pool(ngx_pool_t *pool);

void *ngx_palloc(ngx_pool_t *pool, size_t size);
void *ngx_pnalloc(ngx_pool_t *pool, size_t size);
void *ngx_pcalloc(ngx_pool_t *pool, size_t size);
void *ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment);
ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p);



#endif /* _NGX_PALLOC_H_INCLUDED_ */

  • 9
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

luciferau

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值