Server IP : 85.214.239.14 / Your IP : 3.149.29.190 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/proc/3/root/proc/2/task/2/root/usr/include/postgresql/9.6/server/storage/ |
Upload File : |
/*------------------------------------------------------------------------- * * shm_toc.h * shared memory segment table of contents * * This is intended to provide a simple way to divide a chunk of shared * memory (probably dynamic shared memory allocated via dsm_create) into * a number of regions and keep track of the addresses of those regions or * key data structures within those regions. This is not intended to * scale to a large number of keys and will perform poorly if used that * way; if you need a large number of pointers, store them within some * other data structure within the segment and only put the pointer to * the data structure itself in the table of contents. * * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/storage/shm_toc.h * *------------------------------------------------------------------------- */ #ifndef SHM_TOC_H #define SHM_TOC_H #include "storage/shmem.h" struct shm_toc; typedef struct shm_toc shm_toc; extern shm_toc *shm_toc_create(uint64 magic, void *address, Size nbytes); extern shm_toc *shm_toc_attach(uint64 magic, void *address); extern void *shm_toc_allocate(shm_toc *toc, Size nbytes); extern Size shm_toc_freespace(shm_toc *toc); extern void shm_toc_insert(shm_toc *toc, uint64 key, void *address); extern void *shm_toc_lookup(shm_toc *toc, uint64 key); /* * Tools for estimating how large a chunk of shared memory will be needed * to store a TOC and its dependent objects. */ typedef struct { Size space_for_chunks; Size number_of_keys; } shm_toc_estimator; #define shm_toc_initialize_estimator(e) \ ((e)->space_for_chunks = 0, (e)->number_of_keys = 0) #define shm_toc_estimate_chunk(e, sz) \ ((e)->space_for_chunks = add_size((e)->space_for_chunks, \ BUFFERALIGN((sz)))) #define shm_toc_estimate_keys(e, cnt) \ ((e)->number_of_keys = add_size((e)->number_of_keys, (cnt))) extern Size shm_toc_estimate(shm_toc_estimator *); #endif /* SHM_TOC_H */