Loading include/spdk/env.h +15 −29 Original line number Diff line number Diff line Loading @@ -53,29 +53,25 @@ struct spdk_pci_device; * Allocate a pinned, physically contiguous memory buffer with the * given size and alignment. */ void * spdk_malloc(size_t size, size_t align, uint64_t *phys_addr); void *spdk_malloc(size_t size, size_t align, uint64_t *phys_addr); /** * Allocate a pinned, physically contiguous memory buffer with the * given size and alignment. The buffer will be zeroed. */ void * spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr); void *spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr); /** * Resize the allocated and pinned memory buffer with the given * new size and alignment. Existing contents are preserved. */ void * spdk_realloc(void *buf, size_t size, size_t align, uint64_t *phys_addr); void *spdk_realloc(void *buf, size_t size, size_t align, uint64_t *phys_addr); /** * Free a memory buffer previously allocated with spdk_zmalloc. * This call is never made from the performance path. */ void spdk_free(void *buf); void spdk_free(void *buf); /** * Reserve a named, process shared memory zone with the given size, Loading @@ -84,28 +80,24 @@ spdk_free(void *buf); * cannot be done, return NULL. * Note: to pick any socket id, just set socket_id to -1. */ void * spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags); void *spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags); /** * Lookup the memory zone identified by the given name. * Return a pointer to the reserved memory address. If the reservation * cannot be found, return NULL. */ void * spdk_memzone_lookup(const char *name); void *spdk_memzone_lookup(const char *name); /** * Free the memory zone identified by the given name. */ int spdk_memzone_free(const char *name); int spdk_memzone_free(const char *name); /** * Dump debug information about all memzones. */ void spdk_memzone_dump(FILE *f); void spdk_memzone_dump(FILE *f); struct spdk_mempool; Loading @@ -114,40 +106,34 @@ struct spdk_mempool; * elements in a thread-local cache. Can be 0 for no caching, or -1 * for unspecified. */ struct spdk_mempool * spdk_mempool_create(const char *name, size_t count, struct spdk_mempool *spdk_mempool_create(const char *name, size_t count, size_t ele_size, size_t cache_size); /** * Free a memory pool. */ void spdk_mempool_free(struct spdk_mempool *mp); void spdk_mempool_free(struct spdk_mempool *mp); /** * Get an element from a memory pool. If no elements remain, return NULL. */ void * spdk_mempool_get(struct spdk_mempool *mp); void *spdk_mempool_get(struct spdk_mempool *mp); /** * Put an element back into the memory pool. */ void spdk_mempool_put(struct spdk_mempool *mp, void *ele); void spdk_mempool_put(struct spdk_mempool *mp, void *ele); /** * Put multiple elements back into the memory pool. */ void spdk_mempool_put_bulk(struct spdk_mempool *mp, void *const *ele_arr, size_t count); void spdk_mempool_put_bulk(struct spdk_mempool *mp, void *const *ele_arr, size_t count); /** * Return true if the calling process is primary process */ bool spdk_process_is_primary(void); bool spdk_process_is_primary(void); /** * Get a monotonic timestamp counter. Loading Loading
include/spdk/env.h +15 −29 Original line number Diff line number Diff line Loading @@ -53,29 +53,25 @@ struct spdk_pci_device; * Allocate a pinned, physically contiguous memory buffer with the * given size and alignment. */ void * spdk_malloc(size_t size, size_t align, uint64_t *phys_addr); void *spdk_malloc(size_t size, size_t align, uint64_t *phys_addr); /** * Allocate a pinned, physically contiguous memory buffer with the * given size and alignment. The buffer will be zeroed. */ void * spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr); void *spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr); /** * Resize the allocated and pinned memory buffer with the given * new size and alignment. Existing contents are preserved. */ void * spdk_realloc(void *buf, size_t size, size_t align, uint64_t *phys_addr); void *spdk_realloc(void *buf, size_t size, size_t align, uint64_t *phys_addr); /** * Free a memory buffer previously allocated with spdk_zmalloc. * This call is never made from the performance path. */ void spdk_free(void *buf); void spdk_free(void *buf); /** * Reserve a named, process shared memory zone with the given size, Loading @@ -84,28 +80,24 @@ spdk_free(void *buf); * cannot be done, return NULL. * Note: to pick any socket id, just set socket_id to -1. */ void * spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags); void *spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags); /** * Lookup the memory zone identified by the given name. * Return a pointer to the reserved memory address. If the reservation * cannot be found, return NULL. */ void * spdk_memzone_lookup(const char *name); void *spdk_memzone_lookup(const char *name); /** * Free the memory zone identified by the given name. */ int spdk_memzone_free(const char *name); int spdk_memzone_free(const char *name); /** * Dump debug information about all memzones. */ void spdk_memzone_dump(FILE *f); void spdk_memzone_dump(FILE *f); struct spdk_mempool; Loading @@ -114,40 +106,34 @@ struct spdk_mempool; * elements in a thread-local cache. Can be 0 for no caching, or -1 * for unspecified. */ struct spdk_mempool * spdk_mempool_create(const char *name, size_t count, struct spdk_mempool *spdk_mempool_create(const char *name, size_t count, size_t ele_size, size_t cache_size); /** * Free a memory pool. */ void spdk_mempool_free(struct spdk_mempool *mp); void spdk_mempool_free(struct spdk_mempool *mp); /** * Get an element from a memory pool. If no elements remain, return NULL. */ void * spdk_mempool_get(struct spdk_mempool *mp); void *spdk_mempool_get(struct spdk_mempool *mp); /** * Put an element back into the memory pool. */ void spdk_mempool_put(struct spdk_mempool *mp, void *ele); void spdk_mempool_put(struct spdk_mempool *mp, void *ele); /** * Put multiple elements back into the memory pool. */ void spdk_mempool_put_bulk(struct spdk_mempool *mp, void *const *ele_arr, size_t count); void spdk_mempool_put_bulk(struct spdk_mempool *mp, void *const *ele_arr, size_t count); /** * Return true if the calling process is primary process */ bool spdk_process_is_primary(void); bool spdk_process_is_primary(void); /** * Get a monotonic timestamp counter. Loading