iron261 / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

improve memory management #359

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This patch makes some small improvements to memory management:

1. replaced malloc/memset with calloc
2. removed memset after calloc - unnecessary re-settting of memory

Original issue reported on code.google.com by boxe...@gmail.com on 19 Jun 2014 at 9:21

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by antonin on 17 Jul 2014 at 7:29

GoogleCodeExporter commented 9 years ago

Original comment by m.darb...@gmail.com on 15 Sep 2014 at 2:11

GoogleCodeExporter commented 9 years ago
Aaron,

There's an error in the patch you submitted :
t1.c:1190
-memset(t1->flags,0,flagssize * sizeof(opj_flag_t));

This memset is still necessary.
Here's the new patch that has been verified against the test dataset

Original comment by m.darb...@gmail.com on 15 Sep 2014 at 3:51

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks. I had fixed this error, but had not updated the ticket.

You can find the latest version of my clean up here:

https://github.com/OpenJPEG/openjpeg/commit/07a891b4ec682b30394e8e5db5913e6b7580
a2bf

Also, if you want to request corrections, do you mind making a github pull 
request ?

Original comment by boxe...@gmail.com on 15 Sep 2014 at 8:47

GoogleCodeExporter commented 9 years ago
calloc.patch verified on CDash : OK

The patch is in sync with github patch for calloc/memset.
There are some allocation checks added on github. I think they should be fixed 
with Issue 355 which addresses these checks.

AAron, sorry about github but I haven't start using it (I know I should)...

Original comment by m.darb...@gmail.com on 15 Sep 2014 at 9:23

GoogleCodeExporter commented 9 years ago
Thanks, Matthieu. When you're ready, I think you will enjoy it.
Cheers,
Aaron

Original comment by boxe...@gmail.com on 16 Sep 2014 at 2:20

GoogleCodeExporter commented 9 years ago
patch can be safely applied

Original comment by antonin on 16 Sep 2014 at 11:20

GoogleCodeExporter commented 9 years ago

Original comment by antonin on 16 Sep 2014 at 11:25

GoogleCodeExporter commented 9 years ago

Original comment by antonin on 16 Sep 2014 at 11:40

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2879.

Original comment by antonin on 16 Sep 2014 at 3:48