Skip to content
This repository

Memory leak with hop_buckets in ops #729

Closed
petdance opened this Issue March 05, 2012 · 2 comments

1 participant

Andy Lester
Andy Lester

compilers/opsc/src/Ops/Trans/C.pm creates boilerplate code for a number of ops files:

src/dynoplibs/bit_ops.c
src/dynoplibs/debug_ops.c
src/dynoplibs/io_ops.c
src/dynoplibs/math_ops.c
src/dynoplibs/obscure_ops.c
src/dynoplibs/sys_ops.c
src/dynoplibs/trans_ops.c
src/ops/core_ops.c

In each of these, there's a static HOP *hop_buckets at the top of each file. Then, in hop_init() an automatic variable hop_buckets gets big chunks of memory allocated. Then in hop_deinit(), the static hop_buckets is freed, which does nothing because the static has never been set.

Thanks to GCC's -Wshadow argument for finding the local hop_buckets that shadows the static hop_buckets.

Andy Lester petdance closed this March 05, 2012
Andy Lester petdance reopened this March 17, 2012
Andy Lester

src/ops/core_ops.c still needs to be rebuilt and committed.

Andy Lester

rebuilt and committed.

Andy Lester petdance closed this March 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.