small: introduce small/static
Before the patch Tarantool had a thread- and C-file- local array of 4 static buffers, each 1028 bytes. It provided an API tt_static_buf() allowing to return them one by one in a cycle. Firstly, it consumed totally 200Kb of BSS memory in summary over all C-files using these buffers. Obviously, it was a bug and was not made intentionally. The buffers were supposed to be a one process-global array. Secondly, even if the bug above had been fixed somehow, sometimes it would have been needed to obtain a bit bigger buffer. For example, to store a UDP packet - ~1.5Kb. This commit replaces these 4 buffers with small/ static allocator which does basically the same, but in more granulated and manoeuvrable way. This commit frees ~188Kb of BSS section. A main motivation for this commit is a wish to use a single global out-of-stack buffer to read UDP packets into it in the SWIM library, and on the other hand do not pad out BSS section with a new SWIM-special static buffer. Now SWIM uses stack for this and in the incoming cryptography SWIM component it will need more.
Showing
- src/box/call.c 1 addition, 0 deletionssrc/box/call.c
- src/box/identifier.c 1 addition, 1 deletionsrc/box/identifier.c
- src/box/identifier.h 0 additions, 1 deletionsrc/box/identifier.h
- src/box/iproto.cc 1 addition, 0 deletionssrc/box/iproto.cc
- src/box/opt_def.c 1 addition, 0 deletionssrc/box/opt_def.c
- src/box/relay.cc 1 addition, 1 deletionsrc/box/relay.cc
- src/box/session.cc 1 addition, 0 deletionssrc/box/session.cc
- src/box/space_def.c 1 addition, 0 deletionssrc/box/space_def.c
- src/box/space_def.h 1 addition, 1 deletionsrc/box/space_def.h
- src/box/sql/sqlLimit.h 1 addition, 1 deletionsrc/box/sql/sqlLimit.h
- src/box/tuple.h 1 addition, 0 deletionssrc/box/tuple.h
- src/box/tuple_format.c 1 addition, 0 deletionssrc/box/tuple_format.c
- src/box/user.cc 1 addition, 0 deletionssrc/box/user.cc
- src/box/vclock.c 1 addition, 1 deletionsrc/box/vclock.c
- src/box/vy_log.c 1 addition, 1 deletionsrc/box/vy_log.c
- src/box/xrow.c 1 addition, 1 deletionsrc/box/xrow.c
- src/lib/coll/coll.c 1 addition, 1 deletionsrc/lib/coll/coll.c
- src/lib/core/fio.c 1 addition, 1 deletionsrc/lib/core/fio.c
- src/lib/core/say.c 1 addition, 0 deletionssrc/lib/core/say.c
- src/lib/core/sio.c 5 additions, 4 deletionssrc/lib/core/sio.c
Loading
Please register or sign in to comment