<-
Apache > HTTP Server > 文件 > 版本 2.4 > 模組

Apache 模組 mod_slotmem_plain

可用語言:  en  |  fr 

說明基於槽的共享記憶體提供者。
狀態擴充
模組識別碼slotmem_plain_module
來源檔案mod_slotmem_plain.c

摘要

mod_slotmem_plain 是一個記憶體提供者,提供建立純粹記憶體區段的功能,其中資料集會依「槽」組織。

如果記憶體需要在執行緒和程序之間共享,比較好的提供者是 mod_slotmem_shm

mod_slotmem_plain 提供以下 API 函數

/* call the callback on all worker slots */
apr_status_t doall(ap_slotmem_instance_t *s, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool)

/* create a new slotmem with each item size is item_size */
apr_status_t create(ap_slotmem_instance_t **new, const char *name, apr_size_t item_size, unsigned int item_num, ap_slotmem_type_t type, apr_pool_t *pool)

/* attach to an existing slotmem */
apr_status_t attach(ap_slotmem_instance_t **new, const char *name, apr_size_t *item_size, unsigned int *item_num, apr_pool_t *pool)

/* get the direct pointer to the memory associated with this worker slot */
apr_status_t dptr(ap_slotmem_instance_t *s, unsigned int item_id, void **mem)

/* get/read the memory from this slot to dest */
apr_status_t get(ap_slotmem_instance_t *s, unsigned int item_id, unsigned char *dest, apr_size_t dest_len)

/* put/write the data from src to this slot */
apr_status_t put(ap_slotmem_instance_t *slot, unsigned int item_id, unsigned char *src, apr_size_t src_len)

/* return the total number of slots in the segment */
unsigned int num_slots(ap_slotmem_instance_t *s)

/* return the total data size, in bytes, of a slot in the segment */
apr_size_t slot_size(ap_slotmem_instance_t *s)

/* grab or allocate the first free slot and mark as in-use (does not do any data copying) */
apr_status_t grab(ap_slotmem_instance_t *s, unsigned int *item_id)

/* forced grab or allocate the specified slot and mark as in-use (does not do any data copying) */
apr_status_t fgrab(ap_slotmem_instance_t *s, unsigned int item_id)

/* release or free a slot and mark as not in-use (does not do any data copying) */
apr_status_t release(ap_slotmem_instance_t *s, unsigned int item_id)
Support Apache!

指令

此模組不提供任何指令。

修正程式查核表

另請參閱

可用語言:  en  |  fr 

top

留言

注意事項
此處並非問答區。在此處張貼的留言應以建議改善文件或伺服器為目的,若我們的管理員認為這些建議已落實或無效/離題,可能會將其移除。與 Apache HTTP Server 管理相關的問題應該 направляться至 Libera.chat 上的 IRC 頻道 #httpd,或寄送至我們的郵件列表