@@ -79,8 +79,6 @@ struct sprinter_tree_priv {
7979 lyplg_ext_compile_log(cctx, ext, LY_LLERR, LY_EINT, "Internal error (%s:%d).", __FILE__, __LINE__); \
8080 return LY_EINT
8181
82- #define CTXP_MEM_SIZE (SIZE ) ((SIZE) + ((~(SIZE) + 1) & (8 - 1)))
83-
8482/**
8583 * @brief Check if given mount point is unique among its siblings
8684 *
@@ -1468,20 +1466,20 @@ schema_mount_compiled_size(const struct lysc_ext_instance *ext, struct ly_ht *ad
14681466 return 0 ;
14691467 }
14701468
1471- size += CTXP_MEM_SIZE (sizeof * sm_data );
1469+ size += LY_CTXP_MEM_SIZE (sizeof * sm_data );
14721470
14731471 /* ht addr check, make sure the shared context is stored only once */
14741472 hash = lyht_hash ((const char * )& sm_data -> shared , sizeof sm_data -> shared );
14751473 if (lyht_insert (addr_ht , & sm_data -> shared , hash , NULL ) == LY_EEXIST ) {
14761474 return size ;
14771475 }
14781476
1479- size += CTXP_MEM_SIZE (sizeof * sm_data -> shared );
1480- size += CTXP_MEM_SIZE (sm_data -> shared -> schema_count * sizeof * sm_data -> shared -> schemas );
1477+ size += LY_CTXP_MEM_SIZE (sizeof * sm_data -> shared );
1478+ size += LY_CTXP_MEM_SIZE (sm_data -> shared -> schema_count * sizeof * sm_data -> shared -> schemas );
14811479 for (i = 0 ; i < sm_data -> shared -> schema_count ; ++ i ) {
1482- size += CTXP_MEM_SIZE (ly_ctx_compiled_size (sm_data -> shared -> schemas [i ].ctx ));
1483- size += CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].mount_point ) + 1 );
1484- size += CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].content_id ) + 1 );
1480+ size += LY_CTXP_MEM_SIZE (ly_ctx_compiled_size (sm_data -> shared -> schemas [i ].ctx ));
1481+ size += LY_CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].mount_point ) + 1 );
1482+ size += LY_CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].content_id ) + 1 );
14851483 }
14861484
14871485 /* inlined contexts cannot be reused and will not be printed */
@@ -1501,7 +1499,7 @@ schema_mount_compiled_print(const struct lysc_ext_instance *orig_ext, struct lys
15011499
15021500 /* sm_data */
15031501 ext -> compiled = sm_data = * mem ;
1504- * mem = (char * )* mem + CTXP_MEM_SIZE (sizeof * sm_data );
1502+ * mem = (char * )* mem + LY_CTXP_MEM_SIZE (sizeof * sm_data );
15051503
15061504 pthread_mutexattr_init (& attr );
15071505 pthread_mutexattr_setpshared (& attr , PTHREAD_PROCESS_SHARED );
@@ -1517,15 +1515,15 @@ schema_mount_compiled_print(const struct lysc_ext_instance *orig_ext, struct lys
15171515
15181516 /* sm_data->shared */
15191517 sm_data -> shared = * mem ;
1520- * mem = (char * )* mem + CTXP_MEM_SIZE (sizeof * sm_data -> shared );
1518+ * mem = (char * )* mem + LY_CTXP_MEM_SIZE (sizeof * sm_data -> shared );
15211519
15221520 sm_data -> shared -> schema_count = orig_sm_data -> shared -> schema_count ;
15231521 sm_data -> shared -> ref_count = orig_sm_data -> shared -> ref_count ;
15241522
15251523 /* sm_data->shared->schemas */
15261524 if (orig_sm_data -> shared -> schemas ) {
15271525 sm_data -> shared -> schemas = * mem ;
1528- * mem = (char * )* mem + CTXP_MEM_SIZE (sm_data -> shared -> schema_count * sizeof * sm_data -> shared -> schemas );
1526+ * mem = (char * )* mem + LY_CTXP_MEM_SIZE (sm_data -> shared -> schema_count * sizeof * sm_data -> shared -> schemas );
15291527
15301528 for (i = 0 ; i < sm_data -> shared -> schema_count ; ++ i ) {
15311529 /* ctx */
@@ -1538,12 +1536,12 @@ schema_mount_compiled_print(const struct lysc_ext_instance *orig_ext, struct lys
15381536 /* mount_point */
15391537 strcpy (* mem , orig_sm_data -> shared -> schemas [i ].mount_point );
15401538 sm_data -> shared -> schemas [i ].mount_point = * mem ;
1541- * mem = (char * )* mem + CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].mount_point ) + 1 );
1539+ * mem = (char * )* mem + LY_CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].mount_point ) + 1 );
15421540
15431541 /* content_id */
15441542 strcpy (* mem , orig_sm_data -> shared -> schemas [i ].content_id );
15451543 sm_data -> shared -> schemas [i ].content_id = * mem ;
1546- * mem = (char * )* mem + CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].content_id ) + 1 );
1544+ * mem = (char * )* mem + LY_CTXP_MEM_SIZE (strlen (sm_data -> shared -> schemas [i ].content_id ) + 1 );
15471545 }
15481546 }
15491547
0 commit comments