summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_slab.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-08-08Slab: fixed initialization on win32.Ruslan Ermilov1-10/+13
On Windows, a worker process does not call ngx_slab_init() from ngx_init_zone_pool(), so ngx_slab_max_size, ngx_slab_exact_size, and ngx_slab_exact_shift were left uninitialized.
2017-07-04Slab: fixed small allocations on systems with large pagesize.Ruslan Ermilov1-4/+13
Notably, on ppc64 with 64k pagesize, slab 0 (of size 8) requires 128 64-bit elements for bitmasks. The code bogusly assumed that one uintptr_t is enough for bitmasks plus at least one free slot.
2017-07-04Slab: style.Ruslan Ermilov1-10/+10
2016-12-24Win32: support 64-bit compilation with MSVC.Maxim Dounin1-3/+3
There are lots of C4244 warnings (conversion from 'type1' to 'type2', possible loss of data), so they were disabled. The same applies to C4267 warnings (conversion from 'size_t' to 'type', possible loss of data), most notably - conversion from ngx_str_t.len to ngx_variable_value_t.len (which is unsigned:28). Additionally, there is at least one case when it is not possible to fix the warning properly without introducing win32-specific code: recv() on win32 uses "int len", while POSIX defines "size_t len". The ssize_t type now properly defined for 64-bit compilation with MSVC. Caught by warning C4305 (truncation from '__int64' to 'ssize_t'), on "cutoff = NGX_MAX_SIZE_T_VALUE / 10" in ngx_atosz()). Several C4334 warnings (result of 32-bit shift implicitly converted to 64 bits) were fixed by adding explicit conversions. Several C4214 warnings (nonstandard extension used: bit field types other than int) in ngx_http_script.h fixed by changing bit field types from uintptr_t to unsigned.
2016-12-08Slab: commented bitmap initialization for small allocations.Ruslan Ermilov1-0/+1
2016-12-07Slab: free pages statistics.Ruslan Ermilov1-0/+5
2016-12-07Slab: slots statistics.Ruslan Ermilov1-11/+46
For each slot, the number of total and used entries, as well as the number of allocation requests and failures, are tracked.
2016-12-07Slab: simplified some math.Ruslan Ermilov1-17/+12
No functional changes.
2016-12-07Slab: simplified allocation from slots.Ruslan Ermilov1-79/+61
Removed code that would cause an endless loop, and removed condition check that is always false. The first page in the slot list is guaranteed to satisfy an allocation.
2016-12-07Slab: fixed the number of pages calculation.Ruslan Ermilov1-0/+1
When estimating the number of pages, do not count memory for slots. In some cases this gives one extra usable memory page.
2016-12-07Slab: added comment about list heads.Ruslan Ermilov1-1/+4
2016-12-07Slab: improved code readability.Ruslan Ermilov1-54/+49
No functional changes.
2016-12-03Slab: improved double free detection.Ruslan Ermilov1-1/+1
Previously, an attempt to double free the starting page of the free range was not detected.
2016-12-03Slab: always show the requested allocation size in debug messages.Ruslan Ermilov1-1/+0
Previously, allocations smaller than min_size were shown as min_size.
2016-12-03Slab: style.Ruslan Ermilov1-3/+3
Removed redundant parentheses. No functional changes.
2016-03-31Fixed logging.Sergey Kandaurov1-1/+2
2016-03-30Style.Ruslan Ermilov1-4/+4
2014-06-18Core: bugfix for the ngx_slab_max_size case.Jianjun Zheng1-1/+1
2014-06-04Core: added ngx_slab_calloc() and ngx_slab_calloc_locked().Ruslan Ermilov1-0/+29
These functions return zeroed memory, analogous to ngx_pcalloc().
2014-06-03Core: slab allocator free pages defragmentation.Maxim Dounin1-1/+59
Large allocations from a slab pool result in free page blocks being fragmented, eventually leading to a situation when no further allocation larger than a page size are possible from the pool. While this isn't a problem for nginx itself, it is known to be bad for various 3rd party modules. Fix is to merge adjacent blocks of free pages in the ngx_slab_free_pages() function. Prodded by Wandenberg Peixoto and Yichun Zhang.
2014-03-31Core: slab log_nomem flag.Maxim Dounin1-1/+5
The flag allows to suppress "ngx_slab_alloc() failed: no memory" messages from a slab allocator, e.g., if an LRU expiration is used by a consumer and allocation failures aren't fatal. The flag is now used in the SSL session cache code, and in the limit_req module.
2013-09-04Handling of ngx_int_t != intptr_t case.Maxim Dounin1-1/+2
Casts between pointers and integers produce warnings on size mismatch. To silence them, cast to (u)intptr_t should be used. Prevoiusly, casts to ngx_(u)int_t were used in some cases, and several ngx_int_t expressions had no casts. As of now it's mostly style as ngx_int_t is defined as intptr_t.
2012-08-30Fixed overflow if ngx_slab_alloc() is called with very big "size" argument.Ruslan Ermilov1-2/+2
2012-07-26Reduced the number of preprocessor directives.Ruslan Ermilov1-5/+1
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-10-24Using of junk value in slab allocator similar to modern FreeBSD values.Igor Sysoev1-2/+2
2011-10-24malloc() debugging on MacOSX.Igor Sysoev1-2/+2
2009-04-15fix building by BCC without NGX_DEBUG_MALLOCIgor Sysoev1-2/+2
2009-03-27improve ngx_slab_alloc() error loggingIgor Sysoev1-12/+22
2009-03-27delete old debugging and infoIgor Sysoev1-23/+0
2009-01-25fix slab page or more sized allocations if nginx was build without debugIgor Sysoev1-5/+0
2009-01-12style fixIgor Sysoev1-1/+1
2007-12-22take MALLOC_OPTIONS=J into account in slab allocatorIgor Sysoev1-1/+14
2007-11-16the simple expression has the same precision without overflowIgor Sysoev1-4/+1
2007-01-11fix slab allocator on 64-bit platfromsIgor Sysoev1-2/+2
2007-01-11fix slab allocator on 64-bit platfromsIgor Sysoev1-7/+8
2007-01-02style fixIgor Sysoev1-1/+1
2007-01-02many bug fixes and ngx_slab_alloc_locked()/ngx_slab_free_locked()Igor Sysoev1-26/+48
2006-11-27fix building on 64-bit platformsIgor Sysoev1-4/+4
2006-11-20slab allocator in shared memoryIgor Sysoev1-2/+676
2006-10-28undo the previous wrong commitIgor Sysoev1-35/+2
2006-10-28bad commitIgor Sysoev1-2/+35
2004-09-29nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyrightIgor Sysoev1-1/+1
2004-09-28nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused filesIgor Sysoev1-2/+5
2004-06-16nginx-0.0.7-2004-06-16-23:36:07 importIgor Sysoev1-0/+8