vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I updated the style of your patch, and added a little to your comment block about how to use this capability. I don't think any additional documentation is necessary. Thanks. --------------------------------------------------------------------------- Marc Munro wrote: -- Start of PGP signed section. > The attached patch provides add-ins with the means to register for > shared memory and LWLocks. This greatly improves the ease with which > shared memory may be used from add-ins, while keeping the accounting and > management for that shared memory separate. > > Specifically it adds named add-in shared memory contexts. From these, > memory can be allocated without affecting the memory available in other > contexts. > > Usage is as follows: > from add-in functions called from preload_libraries, you may call > RegisterAddinContext(const * name, size_t size) > to register a new (logical) shared memory segment. > > and > RegisterAddinLWLock(LWLockid *lock_ptr); > to request that a LWLock be allocated, placed into *lock_ptr. > > The actual creation of the shared memory segment and lwlocks is > performed later as part of shared memory initialisation. > > To allocate shared memory from a named context you would use > ShmemAllocFromContext(size_t size, const char *name); > > To reset a shared memory context back to its original unused state (from > which new allocations may be performed), you may use > ShmemResetContext(const char *name); > > This works for me (for Veil) and make check runs fine. > > I have not included any documentation updates in the patch as I'm not > sure where such API changes should be documented. > > All comments, questions and suggestions are welcomed. > > __ > Marc [ Attachment, skipping... ] -- End of PGP section, PGP failed! -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |