# HG changeset patch # User Nina Engelhardt # Date 1341913366 -7200 # Node ID a52de05d2e2bfffd5f356cad62993e5224c1ec46 # Parent 7e13c9ecc89c115e9cb255179a3138ffe384773a changed malloc to VMS malloc diff -r 7e13c9ecc89c -r a52de05d2e2b VSs_tinyjpeg/loadjpeg.c --- a/VSs_tinyjpeg/loadjpeg.c Thu Jul 05 04:15:38 2012 -0700 +++ b/VSs_tinyjpeg/loadjpeg.c Tue Jul 10 11:42:46 2012 +0200 @@ -130,7 +130,7 @@ if (fp == NULL) perror("Cannot open image");//exitmessage("Cannot open filename\n"); length_of_file = filesize(fp); - buf = (unsigned char *)malloc(length_of_file + 4); + buf = (unsigned char *)VMS_App__malloc(length_of_file + 4); if (buf == NULL) exitmessage("Not enough memory for loading file\n"); fread(buf, length_of_file, 1, fp); @@ -148,12 +148,12 @@ tinyjpeg_get_size(jdec, &width, &height); // RGB stuff - rgb_data = (uint8_t *)malloc(width * height * RGB_DEPTH); + rgb_data = (uint8_t *)VMS_App__malloc(width * height * RGB_DEPTH); jdec->components[0] = rgb_data; // this jpeg decoder only supports full MCUs for simplicity ntasks = (jdec->mcus_in_width * jdec->mcus_in_height)/ jdec->restart_interval; - jdec_task = (struct jdec_private **) malloc ( ntasks * sizeof(struct jdec_private*)); + jdec_task = (struct jdec_private **) VMS_App__malloc ( ntasks * sizeof(struct jdec_private*)); //VSs setup @@ -191,9 +191,9 @@ tinyjpeg_free(jdec_task[i]); } fclose(fp); - free(buf); - free(rgb_data); - free(jdec_task); + VMS_App__free(buf); + VMS_App__free(rgb_data); + VMS_App__free(jdec_task); return 0; } diff -r 7e13c9ecc89c -r a52de05d2e2b VSs_tinyjpeg/tinyjpeg.c --- a/VSs_tinyjpeg/tinyjpeg.c Thu Jul 05 04:15:38 2012 -0700 +++ b/VSs_tinyjpeg/tinyjpeg.c Tue Jul 10 11:42:46 2012 +0200 @@ -440,9 +440,10 @@ { struct jdec_private *priv; - priv = (struct jdec_private *)calloc(1, sizeof(struct jdec_private)); + priv = (struct jdec_private *)VMS_App__malloc(1* sizeof(struct jdec_private)); if (priv == NULL) return NULL; + memset(priv,0,sizeof(struct jdec_private)); return priv; } @@ -453,7 +454,7 @@ */ void tinyjpeg_free(struct jdec_private *priv) { - free(priv); + VMS_App__free(priv); }