.
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
|
#endif
|
||||||
|
|
||||||
typedef struct _simplereg {
|
typedef struct _simplereg {
|
||||||
|
- size_t bucket_pos;
|
||||||
+ int heap_instance;
|
+ int heap_instance;
|
||||||
int bucket_pos;
|
+ int bucket_pos;
|
||||||
size_t bucket_size;
|
size_t bucket_size;
|
||||||
- int heap_instance;
|
- size_t heap_instance;
|
||||||
- aligned_data **align_data_set ;
|
- aligned_data **align_data_set ;
|
||||||
-} simplereg;
|
-} simplereg;
|
||||||
+ union {
|
+ union {
|
||||||
@ -1084,7 +1085,7 @@
|
|||||||
align_set->bucket_pos = 0;
|
align_set->bucket_pos = 0;
|
||||||
align_set->bucket_size = ALIGN_BUFF_BUCKET_SIZE;
|
align_set->bucket_size = ALIGN_BUFF_BUCKET_SIZE;
|
||||||
align_set->heap_instance = 1;
|
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);
|
+ memset(align_set->align_data._area, 0, size);
|
||||||
+ p = align_set->bucket_size;
|
+ p = align_set->bucket_size;
|
||||||
+ while (p-- > 0){
|
+ while (p-- > 0){
|
||||||
@ -1132,19 +1133,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void align_free_set(void){
|
static void align_free_set(void){
|
||||||
@@ -174,16 +181,16 @@
|
@@ -174,15 +181,16 @@
|
||||||
if (align_set->heap_instance>1) {
|
if (align_set->heap_instance>1) {
|
||||||
align_set->heap_instance--;
|
align_set->heap_instance--;
|
||||||
} else if (align_set->heap_instance ==1) {
|
} else if (align_set->heap_instance ==1) {
|
||||||
- if (align_set->align_data_set){
|
- if (align_set->align_data_set){
|
||||||
- int p;
|
- size_t p;
|
||||||
- for(p=1;p<align_set->bucket_pos;p++){
|
- for(p=1;p<align_set->bucket_pos;p++){
|
||||||
- aligned_data *ptr = align_set->align_data_set[p];
|
- if (align_set->align_data_set[p]) {
|
||||||
- if (ptr) {
|
- free(align_set->align_data_set[p]);
|
||||||
- free(ptr);
|
|
||||||
+ if (align_set->align_data._area){
|
+ if (align_set->align_data._area){
|
||||||
+ int p = align_set->bucket_pos;
|
+ 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]) {
|
+ if (align_set->align_data._set[p]) {
|
||||||
+ free(align_set->align_data._set[p]);
|
+ free(align_set->align_data._set[p]);
|
||||||
+ align_set->align_data._set[p] = NULL;
|
+ align_set->align_data._set[p] = NULL;
|
||||||
@ -1157,7 +1157,7 @@
|
|||||||
}
|
}
|
||||||
align_set->heap_instance=0;
|
align_set->heap_instance=0;
|
||||||
free(align_set);
|
free(align_set);
|
||||||
@@ -226,7 +233,6 @@
|
@@ -225,7 +233,6 @@
|
||||||
#ifdef PPHEAP_NEED_ALIGNMENT
|
#ifdef PPHEAP_NEED_ALIGNMENT
|
||||||
align_free_set();
|
align_free_set();
|
||||||
#endif
|
#endif
|
||||||
@ -1165,7 +1165,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ppheap_renew (ppheap *heap)
|
void ppheap_renew (ppheap *heap)
|
||||||
@@ -416,7 +422,7 @@
|
@@ -415,7 +422,7 @@
|
||||||
// iof_close(O);
|
// iof_close(O);
|
||||||
#ifdef PPHEAP_NEED_ALIGNMENT
|
#ifdef PPHEAP_NEED_ALIGNMENT
|
||||||
/* Todo: only if data%sizeof(aligned_data) != 0 */
|
/* Todo: only if data%sizeof(aligned_data) != 0 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user