diff options
author | Sam James <sam@gentoo.org> | 2022-09-21 14:18:08 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-10-02 04:31:25 +0100 |
commit | a529111f77ff46f4836fe7312e70953bc16587cf (patch) | |
tree | 9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /base/gxclthrd.c | |
parent | Import Ghostscript 9.56.1 (diff) | |
download | ghostscript-gpl-patches-a529111f77ff46f4836fe7312e70953bc16587cf.tar.gz ghostscript-gpl-patches-a529111f77ff46f4836fe7312e70953bc16587cf.tar.bz2 ghostscript-gpl-patches-a529111f77ff46f4836fe7312e70953bc16587cf.zip |
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'base/gxclthrd.c')
-rw-r--r-- | base/gxclthrd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/base/gxclthrd.c b/base/gxclthrd.c index 6af40a7f..c12af70c 100644 --- a/base/gxclthrd.c +++ b/base/gxclthrd.c @@ -113,12 +113,15 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo * will spot the same profile being used, and treat it as a no-op. Otherwise it will try to find * a profile with the 'special' name "OI_PROFILE" and throw an error. */ - if (!gscms_is_threadsafe() || (dev->icc_struct != NULL && - ((dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] != NULL && - strncmp(dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE]->name, - OI_PROFILE, strlen(OI_PROFILE)) == 0) - || (dev->icc_struct->proof_profile != NULL && - strncmp(dev->icc_struct->proof_profile->name, OI_PROFILE, strlen(OI_PROFILE)) == 0)))) { +#define DEV_PROFILE_IS(DEV, PROFILE, MATCH) \ + ((DEV)->icc_struct != NULL &&\ + (DEV)->icc_struct->PROFILE != NULL &&\ + strcmp((DEV)->icc_struct->PROFILE->name, MATCH) == 0) + + if (bg_print || + !gscms_is_threadsafe() || + DEV_PROFILE_IS(dev, device_profile[GS_DEFAULT_DEVICE_PROFILE], OI_PROFILE) || + DEV_PROFILE_IS(dev, proof_profile, OI_PROFILE)) { ndev->icc_struct = gsicc_new_device_profile_array(ndev); if (!ndev->icc_struct) { emprintf1(ndev->memory, @@ -252,7 +255,7 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo } rc_increment(*cachep); ncdev->icc_cache_cl = *cachep; - } else if ((ncdev->icc_cache_cl = gsicc_cache_new(thread_mem)) == NULL) + } else if ((ncdev->icc_cache_cl = gsicc_cache_new(thread_mem->thread_safe_memory)) == NULL) goto out_cleanup; } if (bg_print) { |