mesa/src/glx
Andrii Simiklit 311c82e192 Revert "glx: convert glx_config_create_list to one big calloc"
This reverts commit 35fc7bdf0e.

Unfortunately mentioned commit introduced a memory leak because
`driwindowsMapConfigs` and `createDriMode` functions allocate
small memory portions for each element:
 21,576 (232 direct, 21,344 indirect) bytes in 1 blocks are definitely lost in loss record 1,411 of 1,414
    at 0x483A7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x5D4AA09: createDriMode (dri_common.c:291)
    by 0x5D4ABF5: driConvertConfigs (dri_common.c:310)
    by 0x5D58414: dri3_create_screen (dri3_glx.c:945)
    by 0x5D39829: AllocAndFetchScreenConfigs (glxext.c:815)
    by 0x5D39C57: __glXInitialize (glxext.c:941)
    by 0x5D3290A: GetGLXPrivScreenConfig (glxcmds.c:174)
    by 0x5D34F38: glXQueryExtensionsString (glxcmds.c:1307)
    by 0x4F83038: glXQueryExtensionsString (in /usr/local/lib/libGL.so.1.7.0)
    by 0x4F2EA6B: ??? (in /usr/lib/x86_64-linux-gnu/libwaffle-1.so.0.6.0)
    by 0x4F2A0D7: waffle_display_connect (in /usr/lib/x86_64-linux-gnu/libwaffle-1.so.0.6.0)
    by 0x498F42A: wfl_checked_display_connect (piglit-util-waffle.h:74)

There is one more thing which disallow us to easily fix it are different element sizes
for instance: `glx_config_create_list` allocates memory just for `glx_config`,
`driwindowsMapConfigs` for `driwindows_config` and
`createDriMode` for `__GLXDRIconfigPrivate`.
Yes it is possible but size of such fix
will be more big and complex than original one.
So it make sense only if the malloc overhead
really is a big problem there.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3406>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3406>
2020-03-04 10:19:48 +00:00
..
apple
tests
windows
applegl_glx.c
clientattrib.c
clientinfo.c
compsize.c
create_context.c
dri2.c
dri2.h
dri2_glx.c
dri2_priv.h
dri3_glx.c
dri3_priv.h
dri_common.c
dri_common.h
dri_common_interop.c
dri_common_query_renderer.c
dri_glx.c
dri_sarea.h
drisw_glx.c glx/drisw: fix shm put image fallback 2020-02-25 01:23:01 +00:00
drisw_priv.h
driwindows_glx.c
eval.c
g_glxglvnddispatchfuncs.c
g_glxglvnddispatchindices.h
glx_error.c
glx_error.h
glx_pbuffer.c
glx_query.c
glxclient.h
glxcmds.c
glxconfig.c Revert "glx: convert glx_config_create_list to one big calloc" 2020-03-04 10:19:48 +00:00
glxconfig.h
glxcurrent.c
glxext.c
glxextensions.c
glxextensions.h
glxglvnd.c
glxglvnd.h
glxglvnddispatchfuncs.h
glxhash.c
glxhash.h
indirect_glx.c
indirect_init.h
indirect_texture_compression.c
indirect_transpose_matrix.c
indirect_vertex_array.c
indirect_vertex_array.h
indirect_vertex_array_priv.h
indirect_vertex_program.c
indirect_window_pos.c
meson.build
packrender.h
packsingle.h
pixel.c
pixelstore.c
query_renderer.c
render2.c
renderpix.c
SConscript
single2.c
singlepix.c
vertarr.c
XF86dri.c
xf86dri.h
xf86dristr.h
xfont.c