57 |
57 |
58 if (unlikely (!shapers)) |
58 if (unlikely (!shapers)) |
59 { |
59 { |
60 char *env = getenv ("HB_SHAPER_LIST"); |
60 char *env = getenv ("HB_SHAPER_LIST"); |
61 if (!env || !*env) { |
61 if (!env || !*env) { |
62 (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]); |
62 (void) hb_atomic_ptr_cmpexch (&static_shapers, nullptr, &all_shapers[0]); |
63 return (const hb_shaper_pair_t *) all_shapers; |
63 return (const hb_shaper_pair_t *) all_shapers; |
64 } |
64 } |
65 |
65 |
66 /* Not found; allocate one. */ |
66 /* Not found; allocate one. */ |
67 shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers)); |
67 shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers)); |
68 if (unlikely (!shapers)) { |
68 if (unlikely (!shapers)) { |
69 (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]); |
69 (void) hb_atomic_ptr_cmpexch (&static_shapers, nullptr, &all_shapers[0]); |
70 return (const hb_shaper_pair_t *) all_shapers; |
70 return (const hb_shaper_pair_t *) all_shapers; |
71 } |
71 } |
72 |
72 |
73 memcpy (shapers, all_shapers, sizeof (all_shapers)); |
73 memcpy (shapers, all_shapers, sizeof (all_shapers)); |
74 |
74 |