forked from pool/texlive
.
OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive?expand=0&rev=319
This commit is contained in:
parent
e411099a0c
commit
db530a2969
22
source.dif
22
source.dif
@ -1043,10 +1043,11 @@
|
||||
#endif
|
||||
|
||||
typedef struct _simplereg {
|
||||
- size_t bucket_pos;
|
||||
+ int heap_instance;
|
||||
int bucket_pos;
|
||||
+ int bucket_pos;
|
||||
size_t bucket_size;
|
||||
- int heap_instance;
|
||||
- size_t heap_instance;
|
||||
- aligned_data **align_data_set ;
|
||||
-} simplereg;
|
||||
+ union {
|
||||
@ -1084,7 +1085,7 @@
|
||||
align_set->bucket_pos = 0;
|
||||
align_set->bucket_size = ALIGN_BUFF_BUCKET_SIZE;
|
||||
align_set->heap_instance = 1;
|
||||
- memset(align_set->align_data_set, 0,size);
|
||||
- memset(align_set->align_data_set, 0UL,size);
|
||||
+ memset(align_set->align_data._area, 0, size);
|
||||
+ p = align_set->bucket_size;
|
||||
+ while (p-- > 0){
|
||||
@ -1132,19 +1133,18 @@
|
||||
}
|
||||
|
||||
static void align_free_set(void){
|
||||
@@ -174,16 +181,16 @@
|
||||
@@ -174,15 +181,16 @@
|
||||
if (align_set->heap_instance>1) {
|
||||
align_set->heap_instance--;
|
||||
} else if (align_set->heap_instance ==1) {
|
||||
- if (align_set->align_data_set){
|
||||
- int p;
|
||||
- size_t p;
|
||||
- for(p=1;p<align_set->bucket_pos;p++){
|
||||
- aligned_data *ptr = align_set->align_data_set[p];
|
||||
- if (ptr) {
|
||||
- free(ptr);
|
||||
- if (align_set->align_data_set[p]) {
|
||||
- free(align_set->align_data_set[p]);
|
||||
+ if (align_set->align_data._area){
|
||||
+ int p = align_set->bucket_pos;
|
||||
+ while (p-- > 0){ /* Do not leak allocated mem address on subscript 0 */
|
||||
+ while (p-- > 0){
|
||||
+ if (align_set->align_data._set[p]) {
|
||||
+ free(align_set->align_data._set[p]);
|
||||
+ align_set->align_data._set[p] = NULL;
|
||||
@ -1157,7 +1157,7 @@
|
||||
}
|
||||
align_set->heap_instance=0;
|
||||
free(align_set);
|
||||
@@ -226,7 +233,6 @@
|
||||
@@ -225,7 +233,6 @@
|
||||
#ifdef PPHEAP_NEED_ALIGNMENT
|
||||
align_free_set();
|
||||
#endif
|
||||
@ -1165,7 +1165,7 @@
|
||||
}
|
||||
|
||||
void ppheap_renew (ppheap *heap)
|
||||
@@ -416,7 +422,7 @@
|
||||
@@ -415,7 +422,7 @@
|
||||
// iof_close(O);
|
||||
#ifdef PPHEAP_NEED_ALIGNMENT
|
||||
/* Todo: only if data%sizeof(aligned_data) != 0 */
|
||||
|
Loading…
Reference in New Issue
Block a user