You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2013/03/06 21:54:15 UTC

[jira] [Commented] (TS-977) RecCore usage cleanup

    [ https://issues.apache.org/jira/browse/TS-977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13595105#comment-13595105 ] 

Leif Hedstrom commented on TS-977:
----------------------------------

Moving out to 3.3.2, since it's not critical.
                
> RecCore usage cleanup
> ---------------------
>
>                 Key: TS-977
>                 URL: https://issues.apache.org/jira/browse/TS-977
>             Project: Traffic Server
>          Issue Type: Task
>          Components: Cleanup
>            Reporter: Zhao Yongming
>            Assignee: Zhao Yongming
>            Priority: Minor
>             Fix For: 3.3.2
>
>         Attachments: 0001-RecCore-refine-P_RecCore.i-and-rename-it-to-P_RecCor.patch, 0002-RecCore-remove-unnecessary-IOCORE_-wrapper-on-RecCor.patch, 0003-TS-977-Fix-RecMessageSend-regression.patch
>
>
> in RecCore.*
> {code}
> int RecGetRecordInt(const char *name, RecInt * rec_int, bool lock = true);
> //-------------------------------------------------------------------------
> // RecGetRecordXXX
> //-------------------------------------------------------------------------
> int
> RecGetRecordInt(const char *name, RecInt *rec_int, bool lock)
> {
>   int err;
>   RecData data;
>   if ((err = RecGetRecord_Xmalloc(name, RECD_INT, &data, lock)) == REC_ERR_OKAY)
>     *rec_int = data.rec_int;
>   return err;
> }
> {code}
> and there is something heavy used:
> {code}
> //-------------------------------------------------------------------------
> // Backwards Compatibility Items (REC_ prefix)
> //-------------------------------------------------------------------------
> #define REC_ReadConfigInt32(_var,_config_var_name) do { \
>   RecInt tmp = 0; \
>   RecGetRecordInt(_config_var_name, (RecInt*) &tmp); \
>   _var = (int32_t)tmp; \
> } while (0)
> #define REC_ReadConfigInteger(_var,_config_var_name) do { \
>   RecInt tmp = 0; \
>   RecGetRecordInt(_config_var_name, &tmp); \
>   _var = tmp; \
> } while (0)
> {code}
> and a real case, the REC_ReadConfigInteger is renamed to IOCORE_ReadConfigInteger:
> {code}
> RecInt cache_config_threads_per_disk = 12;
> #define IOCORE_ReadConfigInteger            REC_ReadConfigInteger
>   IOCORE_ReadConfigInteger(cache_config_threads_per_disk, "proxy.config.cache.threads_per_disk");
> {code}
> my question is, why it is so complex in all these renaming? why not just:
> {code}
> RecGetRecordInt("proxy.config.cache.threads_per_disk", &cache_config_threads_per_disk);
> {code}
> brief talk with Leif, we may need to cleanup the use of REC_*. make it a small task here

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira